From 33954f4648f8c95d481b0a7f3621dfa0312a7afd Mon Sep 17 00:00:00 2001 From: Raphael Vallat Date: Sun, 22 Dec 2024 14:46:52 +0100 Subject: [PATCH] Minor fix deprecations mne and pandas --- yasa/hypno.py | 2 +- yasa/staging.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/yasa/hypno.py b/yasa/hypno.py index c568ddb2..3e0488d7 100644 --- a/yasa/hypno.py +++ b/yasa/hypno.py @@ -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. diff --git a/yasa/staging.py b/yasa/staging.py index 8b42705e..d5ce091b 100644 --- a/yasa/staging.py +++ b/yasa/staging.py @@ -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."