-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: Add VariableForwardWindowIndexer #34226
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
The semantics of having a monotonically increasing index with a negative offset is a bit confusing with the current API since the windows always begin from the start of the index. That being said you can create your own custom definition of how the windows should be constructed: https://pandas.pydata.org/pandas-docs/stable/user_guide/computation.html#custom-window-rolling So that being said, I'd be -1 on the idea given the ability to create a custom indexer but open to thoughts from others |
Hello Matthew, Matthew, yes, you are right and my demand can be addressed with already existing feature, except it seems to me that by playing on existing parameters, this should be supported by pandas. I can propose an alternative, relying on existing parameters. |
Sorry for the long delay @yohplala. This issue as actually brought up in #6772, where now you can reverse your original data, apply the rolling aggregation and then flip the result
I don't think we need a dedicated API for this operation so I'm going to close this for now |
Is your feature request related to a problem?
I would like to use the rolling() method with looking-forward window using a negative
window
.I don't remember which other pandas function is using this approach of negative window for reversing the position of the window with respect to the actual index, but it is for the user very convenient.
I was convinced it was existing for rolling, but it appears it is not.
Describe the solution you'd like
The text was updated successfully, but these errors were encountered: