Skip to content

Epochs metadata FutureWarning #12346

@mscheltienne

Description

@mscheltienne

This line

metadata.iloc[:, 0] = ""

is yielding the traceback:

mne\tests\test_epochs.py:4105: in test_make_metadata_bounded_by_row_events
    metadata, events_new, event_id_new = mne.epochs.make_metadata(
mne\epochs.py:2984: in make_metadata
    metadata.iloc[:, 0] = ""
C:\hostedtoolcache\windows\Python\3.11.7\x64\Lib\site-packages\pandas\core\indexing.py:912: in __setitem__
    iloc._setitem_with_indexer(indexer, value, self.name)
C:\hostedtoolcache\windows\Python\3.11.7\x64\Lib\site-packages\pandas\core\indexing.py:1946: in _setitem_with_indexer
    self._setitem_with_indexer_split_path(indexer, value, name)
C:\hostedtoolcache\windows\Python\3.11.7\x64\Lib\site-packages\pandas\core\indexing.py:2039: in _setitem_with_indexer_split_path
    self._setitem_single_column(loc, value, pi)
C:\hostedtoolcache\windows\Python\3.11.7\x64\Lib\site-packages\pandas\core\indexing.py:2158: in _setitem_single_column
    warnings.warn(
E   FutureWarning: Setting an item of incompatible dtype is deprecated and will raise in a future error of pandas. Value '' has dtype incompatible with float64, please explicitly cast to a compatible dtype first.

I'm not a big panda or metadata user, not sure how best to solve it.

Appeared in #12345

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions