DatasetGroupBy does not implement quantile
See original GitHub issueThe 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
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
quantile method on groupby of xarray dataset - Stack Overflow
These are monthly data (38 years of monthly data). I am interested in calculating the quantile values for each month separately. <xarray.Dataset> ...
Read more >xarray.core.groupby.DatasetGroupBy.quantile
Compute the qth quantile over each array in the groups and concatenate them together into a new array. q ( float or sequence...
Read more >pandas.DataFrame.groupby — pandas 1.5.2 documentation
When calling apply and the by argument produces a like-indexed (i.e. a transform) result, add group keys to index to identify pieces. By...
Read more >How to Use Quantile Transforms for Machine Learning
Other nonlinear algorithms may not have this assumption, yet often perform better when variables have a Gaussian distribution.
Read more >How to Calculate Quantiles by Group in Pandas - Statology
You can use the following basic syntax to calculate quantiles by group in Pandas: df.groupby('grouping_variable').quantile(.5).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
the warnings are still there, but at least the quantile works (assuming the tests cover it). I’ll submit this as a PR.
Thank you!