Skip to content

Commit d6666f4

Browse files
committed
drop winodw now resets the index of the returned dataframe
1 parent 1e51992 commit d6666f4

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

braindecode_features/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
from braindecode_features.feature_extraction import extract_ds_features
22
from braindecode_features.serialization import save_features, read_features
33
from braindecode_features.decoding import cross_validate
4-
from braindecode_features.utils import filter_df, add_description
4+
from braindecode_features.utils import filter_df

braindecode_features/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ def drop_window(df, window_i):
108108
windows -= windows.values > window_i
109109
# insert the updated windows again
110110
df.insert(1, window_col, windows)
111+
# reset the index
112+
df.reset_index(drop=True, inplace=True)
111113
return df
112114

113115

@@ -144,7 +146,8 @@ def _get_unfiltered_chs(ds, frequency_bands):
144146
windows_or_raw = 'windows' if hasattr(ds, 'windows') else 'raw'
145147
orig_chs = []
146148
for ch in getattr(ds, windows_or_raw).ch_names:
147-
if any([ch.endswith('-'.join([str(low), str(high)])) for (low, high) in frequency_bands]):
149+
if any([ch.endswith('-'.join([str(low), str(high)]))
150+
for (low, high) in frequency_bands]):
148151
continue
149152
else:
150153
orig_chs.append(ch)

0 commit comments

Comments
 (0)