TextStimulus#

class pymovements.stimulus.TextStimulus(aois: DataFrame, *, aoi_column: str, start_x_column: str, start_y_column: str, width_column: str | None = None, height_column: str | None = None, end_x_column: str | None = None, end_y_column: str | None = None, page_column: str | None = None, trial_column: str | None = None, writing_system: WritingSystem | str = 'left-to-right')[source]#

A DataFrame for the text stimulus that the gaze data was recorded on.

Parameters:
  • aois (pl.DataFrame) – A stimulus dataframe.

  • aoi_column (str) – Name of the column that contains the content of the aois.

  • start_x_column (str) – Name of the column which contains the x coordinate’s start position of the areas of interest.

  • start_y_column (str) – Name of the column which contains the y coordinate’s start position of the areas of interest.

  • width_column (str | None) – Name of the column which contains the width of the area of interest. (default: None)

  • height_column (str | None) – Name of the column which contains the height of the area of interest. (default: None)

  • end_x_column (str | None) – Name of the column which contains the x coordinate’s end position of the areas of interest. (default: None)

  • end_y_column (str | None) – Name of the column which contains the y coordinate’s end position of the areas of interest. (default: None)

  • page_column (str | None) – Name of the column which contains the page information of the area of interest. (default: None)

  • trial_column (str | None) – Name for the column that specifies the unique trial id. (default: None)

  • writing_system (WritingSystem | str) – Writing system of the text. If writing_system is a string, from_descriptor() is used for initialization. (default: 'left-to-right')

Methods

__init__(aois, *, aoi_column, ...[, ...])

from_csv(path, *, aoi_column, ...[, ...])

Load text stimulus from file.

get_aoi(*, row, x_eye, y_eye)

Return the AOI that contains the given gaze row.

split(by)

Split the AOI df.