Skip to content

Proof of concept - public Grouper objects - #8509

Closed
dcherian wants to merge 2 commits into
pydata:mainfrom
dcherian:grouper-public
Closed

dcherian wants to merge 2 commits into
pydata:mainfrom
dcherian:grouper-public

Conversation

@dcherian

@dcherian dcherian commented Dec 2, 2023 •

Copy link
Copy Markdown
Contributor

Not for merging, just proof that it can be done nicely :)

Now builds on #8840
Builds on an older version of #8507

Try it out!

import xarray as xr
from xarray.core.groupers import SeasonGrouper, SeasonResampler

ds = xr.tutorial.open_dataset("air_temperature")

# custom seasons! 
ds.air.groupby(time=SeasonGrouper(["JF", "MAM", "JJAS", "OND"])).mean()

ds.air.resample(time=SeasonResampler(["DJF", "MAM", "JJAS", "ON"])).count()

@dcherian dcherian mentioned this pull request Jul 11, 2024
5 tasks done
@dcherian dcherian closed this Sep 4, 2024
@dcherian dcherian mentioned this pull request Sep 20, 2024
12 of 14 tasks
@dcherian
dcherian deleted the grouper-public branch November 17, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant