Skip to content
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

reduction on cftime object arrays, datetime arrays #101

Closed
dcherian opened this issue May 16, 2022 · 2 comments · Fixed by #105
Closed

reduction on cftime object arrays, datetime arrays #101

dcherian opened this issue May 16, 2022 · 2 comments · Fixed by #105

Comments

@dcherian
Copy link
Collaborator

I'm not sure reductions on datetime arrays work, at least we should test it.

@dcherian
Copy link
Collaborator Author

import xarray as xr

timeNP = xr.DataArray(xr.date_range('2009-01-01', '2012-12-31', use_cftime=False), dims=('time',), name='time')

timeCF = xr.DataArray(xr.date_range('2009-01-01', '2012-12-31', use_cftime=True), dims=('time',), name='time')

xr.set_options(use_flox=True)
timeNP.resample(time='YS').mean() # fails

@dcherian
Copy link
Collaborator Author

We can only really fix this for func="count", engine="flox" I think Xarray should convert to numeric and pass that to flox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant