How to calculate rolling / moving average using python + NumPy / SciPy?
There seems to be no function that simply calculates the moving average on numpy/scipy, leading to convoluted solutions.
There seems to be no function that simply calculates the moving average on numpy/scipy, leading to convoluted solutions.
I’ve got a bunch of polling data; I want to compute a Pandas rolling mean to get an estimate for each day based on a three-day window. According to this question, the rolling_* functions compute the window based on a specified number of values, and not a specific datetime range.
I have a time series object grouped of the type <pandas.core.groupby.SeriesGroupBy object at 0x03F1A9F0>. grouped.sum() gives the desired result but I cannot get rolling_sum to work with the groupby object. Is there any way to apply rolling functions to groupby objects? For example: