Utils#

brainmaze_utils.annotations.utils.create_day_indexes(dfHyp, hour=12, tzinfo=<class 'dateutil.tz.tz.tzlocal'>)#

Creates a day index for each epoch within the annotations, given the day-time hour supplied as input parameter. The format of start and end has to be an integer or a float in a form representing a timestamp, or a timezone aware datetime or Timestamp object. If the start and end format do not include timezone, the local timezone will be used.

brainmaze_utils.annotations.utils.create_duration(dfHyp)#

Creates duration for each epoch within the annotations. (Faster on timestamp)

brainmaze_utils.annotations.utils.filter_by_duration(dfAnnotations, duration)#

Keeps only epochs of the duration given by the input.

brainmaze_utils.annotations.utils.filter_by_key(dfAnnotations, key, value)#

Keeps only annotations given by the key and value within the pandas DataFrame

brainmaze_utils.annotations.utils.merge_annotations(df)#

Merges epochs with the same annotation and end[i-1] == start[i]

brainmaze_utils.annotations.utils.tile_annotations(df, dur_threshold, verbose=False)#

Tiles epochs to the max duration given by dur_threshold in seconds. Reverse to the ‘merge annotations’.

brainmaze_utils.annotations.utils.time_to_local(dfHyp)#

Converts the time into the local timezone. Default by python and PC. Does not enter the timezone explicitely. Cannot be used for creating a annotations figure.

brainmaze_utils.annotations.utils.time_to_timestamp(dfHyp)#

Converts the annotations time to timestamp.

brainmaze_utils.annotations.utils.time_to_timezone(dfHyp, tzinfo)#

Converts the annotations into a timezone. The timezone has to be from a python library dateutil

brainmaze_utils.annotations.utils.time_to_utc(dfHyp)#

Converts time to the UTC format.