lisa.datautils.series_rolling_apply#
- lisa.datautils.series_rolling_apply(series, func, window, window_float_index=True, center=False)[source]#
Apply a function on a rolling window of a series.
- Returns:
The series of results of the function.
- Parameters:
series (pandas.Series) – Series to act on.
func (collections.abc.Callable) – Function to apply on each window. It must take a
pandas.Series
as only parameter and return one value.window (float) – Rolling window width in seconds.
center (bool) – Label values generated by
func
with the center of the window, rather than the highest index in it.window_float_index (bool) – If
True
, the series passed tofunc
will be of typepandas.Index
(float64), in nanoseconds. Disabling is recommended if the index is not used byfunc
since it will remove the need for a conversion.