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/issues/1635#issuecomment-337631240,https://api.github.com/repos/pydata/xarray/issues/1635,337631240,MDEyOklzc3VlQ29tbWVudDMzNzYzMTI0MA==,1217238,2017-10-18T15:31:56Z,2017-10-18T15:31:56Z,MEMBER,"> Note that ndarray.argsort(axis=None) sorts the flattened array, so the returned DataArray should respect this
I'm not a huge fan of auto-flattening for xarray, but I can see this logic.
> Alternative suggestion: have DataArray.argsort() return an ndarray filled with labels from the sorted dimension
I would probably implement a new method for this, maybe `idxsort` for symmetry with `idxmax` (https://github.com/pydata/xarray/issues/60). Though that name could be read several different ways. Maybe `sortby_labels()`?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,266133430
https://github.com/pydata/xarray/issues/1635#issuecomment-337387398,https://api.github.com/repos/pydata/xarray/issues/1635,337387398,MDEyOklzc3VlQ29tbWVudDMzNzM4NzM5OA==,1217238,2017-10-17T22:04:26Z,2017-10-17T22:19:51Z,MEMBER,"It seems like another reasonable choice would be for `DataArray.argsort()` to keep its current value but drop coordinate labels along the sorting dimension. This would give a consistent result for use with broadcasting indexing (https://github.com/pydata/xarray/pull/1473).
I *think* this internal utility function is equivalent to your second argsort:
https://github.com/pydata/xarray/blob/2949558b75a65404a500a237ec54834fd6946d07/xarray/core/nputils.py#L38-L55
In practice, we might use `bottleneck.rankdata()` or `nanrankdata()`:
https://kwgoodman.github.io/bottleneck-doc/reference.html#non-reduce-with-axis","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,266133430