Events classes (blinks, fixations, saccades, events)#
- class pyneon.Events(data: DataFrame | Path, event_name: str = 'custom', id_name: str | None = None)#
Bases:
BaseTabular
Base for event data (blinks, fixations, saccades, “events” messages). Timestamped by
start timestamp [ns]
ortimestamp [ns]
.- Parameters:
data (pandas.DataFrame or pathlib.Path) – DataFrame or path to the CSV file containing the stream data. The data must be indexed by
timestamp [ns]
.event_name (str, optional) – Name of the event type. Defaults to “custom”.
id_name (str, optional) – Name of the column containing the event ID. Defaults to None. If None, the event ID is not included in the data.
- file#
Path to the CSV file containing the event data.
- Type:
- data#
DataFrame containing the event data.
- Type:
- crop(tmin: Number | None = None, tmax: Number | None = None, by: Literal['timestamp', 'row'] = 'timestamp', inplace: bool = False) Events | None #
Crop data to a specific time range based on timestamps or row numbers.
- Parameters:
tmin (number, optional) – Start timestamp/row to crop the data to. If
None
, the minimum timestamp/row in the data is used. Defaults toNone
.tmax (number, optional) – End timestamp/row to crop the data to. If
None
, the maximum timestamp/row in the data is used. Defaults toNone
.by ("timestamp" or "row", optional) – Whether tmin and tmax are UTC timestamps in nanoseconds or row numbers of the stream data. Defaults to “timestamp”.
inplace (bool, optional) – Whether to replace the data in the object with the cropped data. Defaults to False.
- Returns:
Cropped stream if
inplace=False
, otherwiseNone
.- Return type:
Events or None