is_first_pass#

pymovements.measure.reading.is_first_pass(group_columns: list[str] | None = None, word_idx: str | Expr = 'word_idx', run_id: str | Expr = 'run_id') → Expr[source]#

Flag fixations that belong to the first-pass reading of their word.

A run of fixations qualifies as first-pass if it is the word’s first run and no word with a higher index has been fixated before the run starts. Entering from the left is implied: at a run start the previous word differs from the current one and cannot exceed the running maximum. The no-higher-word condition is constant across a run (within a run the running maximum either already exceeded the word or is the word itself), so it needs no run-level broadcast.

Unlike the other annotation expressions, this one combines two different windows internally and therefore takes the group columns as a parameter instead of a trailing .over(...).

Warning

Requires onset-sorted input within each sequence.

Parameters:
  • group_columns (list[str] | None) – Column names used to partition the data into independent reading sequences. If None or empty, the whole table is treated as a single sequence. (default: None)

  • word_idx (str | pl.Expr) – Column name or expression of the fixated word index. (default: 'word_idx')

  • run_id (str | pl.Expr) – Column name or expression of the run ID (see run_id()). (default: 'run_id')

Returns:

Expression producing the is_first_pass column.

Return type:

pl.Expr