html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/pull/3527#issuecomment-554574425,https://api.github.com/repos/pydata/xarray/issues/3527,554574425,MDEyOklzc3VlQ29tbWVudDU1NDU3NDQyNQ==,14808389,2019-11-15T23:55:14Z,2019-11-15T23:55:14Z,MEMBER,"> Which behaviour can you reproduce? ```python ds = xr.Dataset( data_vars={ ""a"": ( (""x"", ""y""), [[1, 11, 26], [2, 12, 22], [3, 13, 23], [4, 16,24], [5, 15, 25]], ) }, coords={""x"": [1, 1, 1, 2, 2], ""y"": [0, 0, 1]}, ).expand_dims({""z"": [0, 1, 1, 2, 2]}) a_ds = ds.groupby(""y"").std().a a_da = ds.a.groupby(""y"").std() a_ds.identical(a_da) ``` which seems to be the same as ```python a_ds = ds.groupby(""y"").mean(""y"").a a_da = ds.a.groupby(""y"").mean(""y"") a_ds.identical(a_da) ``` My impression is that this puts the dimension grouped over to the front: - before: `ds.a.dims == (""z"", ""x"", ""y"")` - afterwards: `a_ds.dims == (""y"", ""z"", ""x"")` But I agree this discussion does not really belong here. So, thanks all!","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-554506074,https://api.github.com/repos/pydata/xarray/issues/3527,554506074,MDEyOklzc3VlQ29tbWVudDU1NDUwNjA3NA==,2448579,2019-11-15T19:57:57Z,2019-11-15T19:57:57Z,MEMBER,"In it goes. Great work as usual, @keewis. Thanks!","{""total_count"": 2, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 2, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-554500568,https://api.github.com/repos/pydata/xarray/issues/3527,554500568,MDEyOklzc3VlQ29tbWVudDU1NDUwMDU2OA==,1217238,2019-11-15T19:41:41Z,2019-11-15T19:41:41Z,MEMBER,"> the difference is [here](https://github.com/pydata/xarray/blob/5f9ca06ef6bd4fcae3605ad8a55ad9085471bd37/xarray/core/groupby.py#L781-L783), where in `DataArrayGroupBy` the original dimension order is restored. `DatasetGroupBy` does not do that, so the test requires the `transpose` It was not entirely obvious to me how to generalize ""restoring dimension order"" to Dataset. On a Dataset, it is not entirely clear which variable dimension order should be copied from. Maybe each variable in the result should have dimension order copied from the variable with the same name in the original dataset? But then what about new variables? I agree @max-sixty, let's not worry about this too much for now.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-554498852,https://api.github.com/repos/pydata/xarray/issues/3527,554498852,MDEyOklzc3VlQ29tbWVudDU1NDQ5ODg1Mg==,5635139,2019-11-15T19:36:50Z,2019-11-15T19:36:50Z,MEMBER,"Dimension reordering has come up a few times before (https://github.com/pydata/xarray/issues/1739, and others that I can't immediately find) I think we should probably have a general solution & standard behavior here. Others should weigh in (CC @shoyer), but I would vote to not worry too much about it here, and prioritize simplicity and consistency with past behavior until we decide on a more general solution. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-554479160,https://api.github.com/repos/pydata/xarray/issues/3527,554479160,MDEyOklzc3VlQ29tbWVudDU1NDQ3OTE2MA==,2448579,2019-11-15T18:39:44Z,2019-11-15T18:39:44Z,MEMBER,"> I can also reproduce this with std Which behaviour can you reproduce? Replacing `mean` with `std` in my last example passes the identical check. Actually this works too ``` a_ds = ds.groupby(""y"").apply(lambda x: x).a a_da = ds.a.groupby(""y"").apply(lambda x: x) a_ds.identical(a_da) ``` ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-554428708,https://api.github.com/repos/pydata/xarray/issues/3527,554428708,MDEyOklzc3VlQ29tbWVudDU1NDQyODcwOA==,14808389,2019-11-15T16:24:19Z,2019-11-15T17:03:40Z,MEMBER,"I can also reproduce this with `std` Edit: I'm fairly certain this is due to what I mentioned in https://github.com/pydata/xarray/pull/3527#issuecomment-553994537","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-554427971,https://api.github.com/repos/pydata/xarray/issues/3527,554427971,MDEyOklzc3VlQ29tbWVudDU1NDQyNzk3MQ==,14808389,2019-11-15T16:22:41Z,2019-11-15T16:22:41Z,MEMBER,"but that's only because `mean` removes `x`, doesn't it?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-554427515,https://api.github.com/repos/pydata/xarray/issues/3527,554427515,MDEyOklzc3VlQ29tbWVudDU1NDQyNzUxNQ==,2448579,2019-11-15T16:21:37Z,2019-11-15T16:21:37Z,MEMBER,"Hmm.. ok calling mean in this example passes the identical check so maybe there's something funny in quantile: ``` ds = xr.Dataset( data_vars={ ""a"": ( (""x"", ""y""), [[1, 11, 26], [2, 12, 22], [3, 13, 23], [4, 16,24], [5, 15, 25]], ) }, coords={""x"": [1, 1, 1, 2, 2], ""y"": [0, 0, 1]}, ).expand_dims({""z"": [0,1,2]}) a_ds = ds.groupby(""y"").mean(""x"").a a_da = ds.a.groupby(""y"").mean(""x"") a_ds.identical(a_da) ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-554404625,https://api.github.com/repos/pydata/xarray/issues/3527,554404625,MDEyOklzc3VlQ29tbWVudDU1NDQwNDYyNQ==,14808389,2019-11-15T15:29:53Z,2019-11-15T15:29:53Z,MEMBER,"well, it was surprising to me. It also might be problematic that it matters if we first pull out a `DataArray` and then compute or the other way around: ```python >>> ds = xr.Dataset( ... data_vars={ ... ""a"": ( ... (""x"", ""y""), ... [[1, 11, 26], [2, 12, 22], [3, 13, 23],^I[4, 16,^I24], [5, 15, 25]], ... ) ... }, ... coords={""x"": [1, 1, 1, 2, 2], ""y"": [0, 0, 1]}, ... ) >>> a_ds = ds.groupby(""y"").quantile(0).a >>> a_da = ds.a.groupby(""y"").quantile(0) >>> a_ds.identical(a_da) False >>> a_ds.transpose().identical(a_da) True ```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-554395077,https://api.github.com/repos/pydata/xarray/issues/3527,554395077,MDEyOklzc3VlQ29tbWVudDU1NDM5NTA3Nw==,2448579,2019-11-15T15:07:55Z,2019-11-15T15:07:55Z,MEMBER,":+1: The transpose is fine, I think. It looks intentional and must be consistent with other Dataset/DataArray operations?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-554394159,https://api.github.com/repos/pydata/xarray/issues/3527,554394159,MDEyOklzc3VlQ29tbWVudDU1NDM5NDE1OQ==,14808389,2019-11-15T15:05:34Z,2019-11-15T15:05:34Z,MEMBER,"sure. But as `Dataset.quantile` and `DataArray.quantile` don't have examples either, I think it might be worth to do that in a new PR? Also, what will we do re `transpose`?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-554391733,https://api.github.com/repos/pydata/xarray/issues/3527,554391733,MDEyOklzc3VlQ29tbWVudDU1NDM5MTczMw==,2448579,2019-11-15T14:59:21Z,2019-11-15T14:59:21Z,MEMBER,"LGTM @keewis. Re: docstring. If you jave time, can you add a couple of examples (just pick two from the tests) to illustrate the scalar vs vector behaviour of `q`?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-553994537,https://api.github.com/repos/pydata/xarray/issues/3527,553994537,MDEyOklzc3VlQ29tbWVudDU1Mzk5NDUzNw==,14808389,2019-11-14T17:31:58Z,2019-11-14T17:58:54Z,MEMBER,"the difference is [here](https://github.com/pydata/xarray/blob/5f9ca06ef6bd4fcae3605ad8a55ad9085471bd37/xarray/core/groupby.py#L781-L783), where in `DataArrayGroupBy` the original dimension order is restored. `DatasetGroupBy` does not do that, so the test requires the `transpose`","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-553650734,https://api.github.com/repos/pydata/xarray/issues/3527,553650734,MDEyOklzc3VlQ29tbWVudDU1MzY1MDczNA==,2448579,2019-11-13T23:21:57Z,2019-11-13T23:21:57Z,MEMBER,:+1:,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-553650563,https://api.github.com/repos/pydata/xarray/issues/3527,553650563,MDEyOklzc3VlQ29tbWVudDU1MzY1MDU2Mw==,14808389,2019-11-13T23:21:23Z,2019-11-13T23:21:23Z,MEMBER,that would open a new category. Should I use `New Features`?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-553650044,https://api.github.com/repos/pydata/xarray/issues/3527,553650044,MDEyOklzc3VlQ29tbWVudDU1MzY1MDA0NA==,2448579,2019-11-13T23:19:50Z,2019-11-13T23:19:50Z,MEMBER,Let's do enhancements!,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336 https://github.com/pydata/xarray/pull/3527#issuecomment-553647261,https://api.github.com/repos/pydata/xarray/issues/3527,553647261,MDEyOklzc3VlQ29tbWVudDU1MzY0NzI2MQ==,14808389,2019-11-13T23:10:34Z,2019-11-13T23:10:34Z,MEMBER,is `Bug Fixes` the correct section for this?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,522523336