You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import pandas as pd
import yasa
hypno = pd.read_csv("yasa_example_night_young_hypno.csv")
yasa.plot_hypnogram(hypno)
AssertionError Traceback (most recent call last)
[<ipython-input-2-b11aab9cd069>](https://localhost:8080/#) in <cell line: 4>()
2 hypno = pd.read_csv("yasa_example_night_young_hypno.csv")
3 import yasa
----> 4 yasa.plot_hypnogram(hypno);
[/usr/local/lib/python3.10/dist-packages/yasa/plotting.py](https://localhost:8080/#) in plot_hypnogram(hyp, lw, highlight, fill_color, ax)
68 from yasa.hypno import Hypnogram # Avoiding circular import
69
---> 70 assert isinstance(hyp, Hypnogram), "`hypno` must be YASA Hypnogram."
71
72 # Work with a copy of the Hypnogram to not alter the original
AssertionError: `hypno` must be YASA Hypnogram.
The text was updated successfully, but these errors were encountered:
Thanks for reporting on this issue. I have just submitted a fix here, but I might wait for a few weeks before releasing a new version of YASA on PyPI. In the meantime, the following code should work:
importpandasaspdimportyasahypno=pd.read_csv("yasa_example_night_young_hypno.csv")
# Convert to the new Hypnogram format, assuming that the hypnogram is at 30-seconds resolutionhyp=yasa.Hypnogram(yasa.hypno_int_to_str(hypno), freq="30s")
yasa.plot_hypnogram(hyp)
The text was updated successfully, but these errors were encountered: