mad_gui.models.local.AnnotationData#
- class mad_gui.models.local.AnnotationData[source]#
Bases:
BaseStateModel
An object that just represents a pandas.DataFrame and makes it possible to bind the dataframe to methods.
This object is used to present starts, ends and descriptions of labels in a plot. It is used in
mad_gui.models.local.PlotData.annotations
.Examples
>>> plot_data = gui.global_data.plot_data >>> for plot, data in plot_data.items(): ... print(f"Sensor {plot}'s annotations are:") ... for label_class, annotation_df in data.annotations.items(): ... print(f"Labels of class {label_class}: ") ... print(annotation_df.data) ... Sensor Pocket IMU's annotations are: Labels of class Base Label: identifier start end description details 0 1687 2238 (sleep,) None
- Attributes:
- data
An object which represents a pandas.DataFrame at least with the columns start and end. Each row encodes one label.
Methods
to_df
()Return the annotations stored in this object as
pandas.DataFrame
- to_df()[source]#
Return the annotations stored in this object as
pandas.DataFrame