Join GitHub today
feature request: rolling with datetime range #13327
I would like to submit one very useful addition to rolling, namely the possibility to compute any statistics over a specific time range.
Indeed, my understanding is that
Instead, it would be very useful to specify something like `rolling(windows=5,type_windows='time_range').mean() to get the rolling mean over the last 5 days.
So if your data starts on January 1 and then the next data point is on Feb 2nd, then the rolling mean for the Feb 2nb point is NA because there was no data on Jan 29, 30, 31, Feb 1, Feb 2.
I believe this would be very useful in settings where data represents trading data, so most of the time the data points are not equidistant in time. Still, you want to compute rolling metrics that are specified over the same delta.
What do you think?
I see, thanks.
But do you know what's wrong here, then?
You need to ATM specify the column to work on as the non-numeric columns don't work very well (e.g. the grouper in this case).
so this is a dupe of #12537
referenced this issue
May 30, 2016
It's probably a whole different issue, but would it ever be possible to specify the column for
Definitely don't let my request hold-up this code change. We can worry about that later; getting windows by timestamp is far more important at this stage.