pymovements.gaze.from_pandas#

pymovements.gaze.from_pandas(data: pd.DataFrame, experiment: Experiment | None = None, events: EventDataFrame | None = None, *, trial_columns: str | list[str] | None = None, time_column: str | None = None, time_unit: str | None = 'ms', pixel_columns: list[str] | None = None, position_columns: list[str] | None = None, velocity_columns: list[str] | None = None, acceleration_columns: list[str] | None = None, distance_column: str | None = None) GazeDataFrame#

Get a GazeDataFrame from a pandas DataFrame.

Parameters:
  • data (pd.DataFrame) – Data represented as a pandas DataFrame.

  • experiment (Experiment | None) – The experiment definition. (default: None)

  • events (EventDataFrame | None) – A dataframe of events in the gaze signal. (default: None)

  • trial_columns (str | list[str] | None) – The name of the trial columns in the input data frame. If the list is empty or None, the input data frame is assumed to contain only one trial. If the list is not empty, the input data frame is assumed to contain multiple trials and the transformation methods will be applied to each trial separately. (default: None)

  • time_column (str | None) – The name of the timestamp column in the input data frame. (default: None)

  • time_unit (str | None) – The unit of the timestamps in the input data frame. Supported units are ‘s’ for seconds, ‘ms’ for milliseconds and ‘step’ for steps. If the unit is ‘step’ the experiment definition must be specified. All timestamps will be converted to milliseconds. (default: ‘ms’)

  • pixel_columns (list[str] | None) – The name of the pixel position columns in the input data frame. (default: None)

  • position_columns (list[str] | None) – The name of the dva position columns in the input data frame. (default: None)

  • velocity_columns (list[str] | None) – The name of the dva velocity columns in the input data frame. (default: None)

  • acceleration_columns (list[str] | None) – The name of the dva acceleration columns in the input data frame. (default: None)

  • distance_column (str | None) – The name of the column containing eye-to-screen distance in millimeters for each sample in the input data frame. If specified, the column will be used for pixel to dva transformations. If not specified, the constant eye-to-screen distance will be taken from the experiment definition. (default: None)

Returns:

Returns gaze data frame read from pandas data frame.

Return type:

GazeDataFrame