flasc.data_processing.time_operations.df_movingaverage

flasc.data_processing.time_operations.df_movingaverage#

flasc.data_processing.time_operations.df_movingaverage(df_in, cols_angular, window_width=datetime.timedelta(seconds=60), min_periods=1, center=True, calc_median_min_max_std=False)[source]#

Compute a moving average of a dataframe with angular columns.

Note that median, minimum, and maximum do not handle angular quantities and should be treated carefully. Standard deviation handles angular quantities.

Parameters:
  • df_in (pd.DataFrame) -- Input dataframe.

  • cols_angular (list) -- List of angular columns.

  • window_width (timedelta) -- Width of the moving average window.

  • min_periods (int) -- Minimum number of periods to consider.

  • center (bool) -- Center the time index. Default is True.

  • calc_median_min_max_std (bool) -- Calculate median, min, max, and std. Default is False.

Returns:

Output dataframe with moving averages.

Return type:

pd.DataFrame