-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add an Cumulative aggregation, similar to Rolling #5215
Comments
I don't entirely get what the function is supposed to do (even after looking at the pandas docstring) - can you give a an example or two? |
IIUC I guess all expanding reductions are basically Like @mathause I find "expanding" confusing. |
The benefit is that the API surface is reduced — e.g. we can have a The implementation could be as simple as |
I'd be up for doing |
Go for it - we can hardly keep up with reviewing ;-) |
I am pretty stoked about the idea of supporting cumulative integrals with the same syntax as other cumulative operations :) |
* Add Cumulative aggregation Closes #5215 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * whatsnew * Update xarray/core/dataarray.py Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com> * Update xarray/core/dataset.py * min_periods defaults to 1 --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Deepak Cherian <dcherian@users.noreply.github.com>
Is your feature request related to a problem? Please describe.
Pandas has a
.expanding
aggregation, which is basically rolling with a full lookback. I often end up supplying rolling with the length of the dimension, and this is some nice sugar for that.Describe the solution you'd like
Basically the same as pandas — a
.expanding
method that returns anExpanding
class, which implements the same methods as aRolling
class.Describe alternatives you've considered
Some options:
– This
– Don't add anything, the sugar isn't worth the additional API.
– Go full out and write specialized expanding algos — which will be faster since they don't have to keep track of the window. But not that much faster, likely not worth the effort.
The text was updated successfully, but these errors were encountered: