pymovements.events.dispersion#

pymovements.events.dispersion(*, position_column: str = 'position', n_components: int = 2) Expr#

Dispersion of an event.

The dispersion is calculated as:

\[\text{Dispersion} = x_{\text{max}} - x_{\text{min}} + y_{\text{max}} - y_{\text{min}}\]

where \((x_{\text{min}},\; x_{\text{max}})\) and \((y_{\text{min}},\; y_{\text{max}})\) are the minimum and maximum values of the \(x\) and \(y\) components of the gaze positions during an event.

Parameters:
  • position_column (str) – The column name of the position tuples. (default: ‘position’)

  • n_components (int) – Number of positional components. Usually these are the two components yaw and pitch. (default: 2)

Returns:

The dispersion of the event.

Return type:

pl.Expr

Raises:

ValueError – If number of components is not 2.