pymovements.gaze.GazeDataFrame.smooth#

GazeDataFrame.smooth(method: str = 'savitzky_golay', window_length: int = 7, degree: int = 2, column: str = 'position', padding: str | float | int | None = 'nearest', **kwargs: int | float | str) None#

Smooth data in a column.

Parameters:
  • method (str) – The method to use for smoothing. Choose from savitzky_golay, moving_average, exponential_moving_average. See smooth() for details. (default: ‘savitzky_golay’)

  • window_length (int) – For moving_average this is the window size to calculate the mean of the subsequent samples. For savitzky_golay this is the window size to use for the polynomial fit. For exponential_moving_average this is the span parameter. (default: 7)

  • degree (int) – The degree of the polynomial to use. This has only an effect if using savitzky_golay as smoothing method. degree must be less than window_length. (default: 2)

  • column (str) – The input column name to which the smoothing is applied. (default: ‘position’)

  • padding (str | float | int | None) – Must be either None, a scalar or one of the strings mirror, nearest or wrap. This determines the type of extension to use for the padded signal to which the filter is applied. When passing None, no extension padding is used. When passing a scalar value, data will be padded using the passed value. See smooth() for details on the padding methods. (default: ‘nearest’)

  • **kwargs (int | float | str) – Additional keyword arguments to be passed to the smooth() method.