pymovements.Dataset.detect_events#
- Dataset.detect_events(method: Callable[[...], Events] | str, *, eye: str = 'auto', clear: bool = False, verbose: bool = True, **kwargs: Any) Dataset[source]#
Detect events by applying a specific event detection method.
- Parameters:
method (Callable[..., Events] | str) – The event detection method to be applied.
eye (str) – Select which eye to choose. Valid options are
auto,left,rightorNone. Ifautois passed, eye is inferred in the order['right', 'left', 'eye']from the availablegazedataframe columns. (default: ‘auto’)clear (bool) –
- If
True, event DataFrame will be overwritten with a new DataFrame instead of being merged into the existing one. (default: False)
- If
verbose (bool) – If
True, show a progress bar. (default: True)**kwargs (Any) – Additional keyword arguments to be passed to the event detection method.
- Returns:
Returns self, useful for method cascading.
- Return type:
- Raises:
AttributeError – If gaze files have not been loaded yet or gaze files do not contain the right columns.