-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
feature request: rolling with datetime range #13327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
you can simply resample first to get your desired results (specifying freq to .rolling does this now as well) |
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 |
thanks jeff. Thats interesting and I would say its a rather sublte bug because I would not think of the grouper as a regular data column that gets processed by what follows |
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. |
that's actually very easy |
Oh, if you're up for it, then can we add that to this feature request? It would be really helpful. |
yes will put it on the list - |
Very excited about this new feature! Thanks ! |
xref pandas-dev#13327 CLN: pep for cython, xref pandas-dev#12995
xref pandas-dev#13327 CLN: pep for cython, xref pandas-dev#12995
xref pandas-dev#13327 CLN: pep for cython, xref pandas-dev#12995
xref #13327 closes #936 Author: Jeff Reback <[email protected]> Closes #13513 from jreback/rolling and squashes the following commits: d8f3d73 [Jeff Reback] ENH: add time-window capability to .rolling
Hello, is this capability currently supported? I am doing a simple |
Hello everyone,
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
rolling(windows=5).mean()
computes, say, the mean over the last five observations.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?
Thanks!
The text was updated successfully, but these errors were encountered: