Skip to content

Commit

Permalink
Minor fix deprecations mne and pandas
Browse files Browse the repository at this point in the history
  • Loading branch information
raphaelvallat committed Dec 22, 2024
1 parent 3d5d509 commit 33954f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion yasa/hypno.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def as_int(self):
Name: Stage, dtype: int16
"""
# Return as int16 (-32768 to 32767) to reduce memory usage
return self.hypno.replace(self.mapping).astype(np.int16)
return self.hypno.map(self.mapping).astype(np.int16)

def consolidate_stages(self, new_n_stages):
"""Reduce the number of stages in a hypnogram to match actigraphy or wearables.
Expand Down
2 changes: 1 addition & 1 deletion yasa/staging.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ def __init__(self, raw, eeg_name, *, eog_name=None, emg_name=None, metadata=None
ch_names = ch_names[keep_chan].tolist()
ch_types = ch_types[keep_chan].tolist()
# Keep only selected channels (creating a copy of Raw)
raw_pick = raw.copy().pick_channels(ch_names, ordered=True)
raw_pick = raw.copy().pick(ch_names)

# Downsample if sf != 100
assert sf > 80, "Sampling frequency must be at least 80 Hz."
Expand Down

0 comments on commit 33954f4

Please sign in to comment.