From 1859771a752e14d2f7c95265843403ba813c77bf Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Wed, 10 Jan 2024 10:34:08 -0500 Subject: [PATCH] MAINT: Fix for pandas pre --- mne/epochs.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mne/epochs.py b/mne/epochs.py index 34d942536bd..c042c207905 100644 --- a/mne/epochs.py +++ b/mne/epochs.py @@ -2977,11 +2977,11 @@ def _ensure_list(x): *last_cols, ] - data = np.empty((len(events_df), len(columns))) + data = np.empty((len(events_df), len(columns)), float) metadata = pd.DataFrame(data=data, columns=columns, index=events_df.index) # Event names - metadata.iloc[:, 0] = "" + metadata["event_name"] = "" # Event times start_idx = 1 @@ -2990,7 +2990,7 @@ def _ensure_list(x): # keep_first and keep_last names start_idx = stop_idx - metadata.iloc[:, start_idx:] = None + metadata[columns[start_idx:]] = "" # We're all set, let's iterate over all events and fill in in the # respective cells in the metadata. We will subset this to include only