deepof.utils.rolling_speed
- deepof.utils.rolling_speed(dframe: DatetimeIndex, window: int = 3, rounds: int = 3, deriv: int = 1, center: str | None = None, shift: int = 2, typ: str = 'coords') DataFrame
Return the average speed over n frames in pixels per frame.
- Parameters:
dframe (pandas.DataFrame) – Position over time dataframe.
window (int) – Number of frames to average over.
rounds (int) – Float rounding decimals.
deriv (int) – Position derivative order; 1 for speed, 2 for acceleration, 3 for jerk, etc.
center (str) – For internal usage only; solves an issue with pandas.MultiIndex that arises when centering frames to a specific body part.
shift (int) – Window shift for rolling speed calculation.
typ (str) – Type of dataset. Intended for internal usage only.
- Returns:
Data frame containing 2D speeds for each body part in the original data or their consequent derivatives.
- Return type:
speeds (pd.DataFrame)