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

DatasetGroupBy does not implement quantile #3525

Closed
keewis opened this issue Nov 13, 2019 · 6 comments · Fixed by #3527
Closed

DatasetGroupBy does not implement quantile #3525

keewis opened this issue Nov 13, 2019 · 6 comments · Fixed by #3527

Comments

@keewis
Copy link
Collaborator

keewis commented Nov 13, 2019

The docs claim quantile works on grouped datasets, but that does not seem to be the case:

>>> import xarray as xr
>>> ds = xr.Dataset(data_vars={"a": ("x", list("abcd"))}, coords={"x": range(4)})
>>> ds.a.groupby(ds.x % 2 == 0).quantile
<bound method DataArrayGroupBy.quantile of DataArrayGroupBy, grouped over 'x' 
2 groups with labels False, True.>
>>> ds.groupby(ds.x % 2 == 0).quantile
AttributeError: 'DatasetGroupBy' object has no attribute 'quantile'

this was found while trying to silence the nit-picky sphinx warnings in #3516

@keewis
Copy link
Collaborator Author

keewis commented Nov 13, 2019

while looking for related issues, I found #3018, so this seems to be known?

@max-sixty
Copy link
Collaborator

OK, fine to leave this open since that's closed

@keewis
Copy link
Collaborator Author

keewis commented Nov 13, 2019

actually, I think the fix proposed in the old issue (move DataArrayGroupBy.quantile to GroupBy) should also silence the warnings, since the other methods in GroupBy work just fine?

@max-sixty
Copy link
Collaborator

That would be great if it's really that simple!

@keewis
Copy link
Collaborator Author

keewis commented Nov 13, 2019

the warnings are still there, but at least the quantile works (assuming the tests cover it). I'll submit this as a PR.

@max-sixty
Copy link
Collaborator

Thank you!

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.

2 participants