pymovements.Gaze.split#

Gaze.split(by: Sequence[str] | None = None) list[Gaze][source]#

Split a single Gaze object into multiple Gaze objects based on specified column(s).

Parameters:

by (Sequence[str] | None) – Column name(s) to split the DataFrame by. If a single string is provided, it will be used as a single column name. If a sequence is provided, the DataFrame will be split by unique combinations of values in all specified columns. If None, uses trial_columns. (default=None)

Returns:

A list of new Gaze instances, each containing a partition of the original data with all metadata and configurations preserved.

Return type:

list[Gaze]