yasa.Hypnogram.to_dict#
- Hypnogram.to_dict()[source]#
Return the Hypnogram as a JSON-serializable dictionary.
All metadata is preserved: epoch duration, start datetime (including timezone), scorer name, and stage probabilities. Stage probabilities (
proba) are rounded to 6 decimal places.The dictionary has the following keys:
"values","n_stages","freq","start","scorer","proba". It can be passed tofrom_dictto reconstruct theHypnogram.Added in version 0.7.0.
- Returns:
- ddict
A JSON-serializable dictionary representing the Hypnogram and all its metadata.