annotate_is_first_pass#

pymovements.measure.reading.annotate_is_first_pass(fixations: DataFrame, group_columns: list[str]) DataFrame[source]#

Annotate fixations with a flag indicating if it belongs to a first-pass reading.

First-pass is defined at the run level. A run qualifies as first-pass if: 1. It is the first time the reader enters the word. 2. The word is entered from the left (forward reading direction). 3. No words with a higher index have been fixated before.

Parameters:
  • fixations (pl.DataFrame) – Fixation-level DataFrame. Must contain word_idx, run_id, prev_word_idx and onset columns.

  • group_columns (list[str]) – Column names used to partition the data into independent reading sequences.

Returns:

Input DataFrame with an additional is_first_pass column.

Return type:

pl.DataFrame