Skip to main content
Ctrl+K

PyNeon dev documentation

  • Tutorials
  • API reference
  • GitHub
  • Tutorials
  • API reference
  • GitHub

Section Navigation

  • Dataset class
  • Recording class
  • Data stream classes (gaze, eye states, IMU)
  • Events classes (blinks, fixations, saccades, events)
  • Epochs class
  • Scene video class
  • Preprocessing module
  • Visualization module
  • Exportation module
  • PyNeon API
  • Events classes (blinks, fixations, saccades, events)

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] or timestamp [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:

pathlib.Path

data#

DataFrame containing the event data.

Type:

pandas.DataFrame

event_name#

Name of the event type.

Type:

str

id_name#

Name of the column containing the event ID.

Type:

str

property start_ts: ndarray#

Start timestamps of events in nanoseconds..

property end_ts: ndarray | None#

End timestamps of events in nanoseconds.

property durations: ndarray | None#

Duration of events in milliseconds.

property id: ndarray | None#

Event ID.

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 to None.

  • tmax (number, optional) – End timestamp/row to crop the data to. If None, the maximum timestamp/row in the data is used. Defaults to None.

  • 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, otherwise None.

Return type:

Events or None

restrict(other: Stream, inplace: bool = False) → Events | None#

Restrict events to a time range defined by another stream.

Parameters:

other (Stream) – Stream to restrict to.

Returns:

Restricted event data.

Return type:

Events

previous

Data stream classes (gaze, eye states, IMU)

next

Epochs class

On this page
  • Events
    • Events.file
    • Events.data
    • Events.event_name
    • Events.id_name
    • Events.start_ts
    • Events.end_ts
    • Events.durations
    • Events.id
    • Events.crop()
    • Events.restrict()

This Page

  • Show Source

© Copyright 2024-2025, PyNeon developers.

Created using Sphinx 8.1.3.

Built with the PyData Sphinx Theme 0.16.1.