Skip to content
This repository has been archived by the owner on Jul 21, 2022. It is now read-only.

CSC-UW/hypnogram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HypnoGra(ha)m

This package is no longer maintained here, and has been moved to ecephys.hypnogram

Core classes

This package provides a Hypnogram class, which is just a subclassed Pandas DataFrame with some useful methods. Every hypnogram should have state, start_time, end_time, and duration columns, and each row should be one bout of a vigilance state. For example:

state 	start_time 	end_time 	duration
NREM 	2020-09-24 15:19:34.989999771 	2020-09-24 15:19:42.989999771 	0 days 00:00:08
  • DatetimeHypnogram objects (e.g. above) expect all start and end times to be pandas datetime objects, and all durations to be pandas timedelta objects.
  • FloatHypnograms expect all time/duration fields to contain floats, which represent times in seconds. FloatHypnogram.as_datetime() can be used to easily convert a FloatHypnogram, which is the natural output format of many sleep scoring softwares, to a DatetimeHypnogram format, which is much easier to manipulate and work with.

About

Simple hypnogram utilities in Python

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages