pymovements.gaze.GazeDataFrame.unnest#

GazeDataFrame.unnest(column: str, output_suffixes: list[str] | None = None, *, output_columns: list[str] | None = None) None[source]#

Explode a column of type pl.List into one column for each list component.

The input column will be dropped.

Parameters:
  • column – Name of input columns to be unnested into several component columns.

  • output_columns – Name of the resulting tuple columns.

  • output_suffixes – Suffixes to append to the column names.

Raises:
  • ValueError – If both output_columns and output_suffixes are specified. If number of output columns / suffixes does not match number of components. If output columns / suffixes are not unique.

  • AttributeError – If number of components is not 2, 4 or 6.