pymovements.gaze.GazeDataFrame.unnest#
- GazeDataFrame.unnest(input_columns: list[str] | str | None = None, output_suffixes: list[str] | None = None, *, output_columns: list[str] | None = None) None #
Explode a column of type
pl.List
into one column for each list component.The input column will be dropped.
- Parameters:
input_columns (list[str] | str | None) – Name(s) of input column(s) to be unnested into several component columns. If None all list columns ‘pixel’, ‘position’, ‘velocity’ and ‘acceleration’ will be unnested if existing. (default: None)
output_suffixes (list[str] | None) – Suffixes to append to the column names. (default: None)
output_columns (list[str] | None) – Name of the resulting tuple columns. (default: None)
- 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. If no columns to unnest exist and none are specified. If output columns are specified and more than one input column is specified.
AttributeError – If number of components is not 2, 4 or 6.
Warning – If no columns to unnest exist and none are specified.