Skip to content

Commit

Permalink
Updated the now deprecated Series.replace() to Series.cat.rename_cate…
Browse files Browse the repository at this point in the history
…gories()

Signed-off-by: S.J. Guillot <[email protected]>
  • Loading branch information
sjg2203 committed Apr 5, 2024
1 parent c734753 commit 8e11879
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion yasa/hypno.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,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.cat.rename_categories(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

0 comments on commit 8e11879

Please sign in to comment.