issues: 1875857414
This data as json
id | node_id | number | title | user | state | locked | assignee | milestone | comments | created_at | updated_at | closed_at | author_association | active_lock_reason | draft | pull_request | body | reactions | performed_via_github_app | state_reason | repo | type |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1875857414 | I_kwDOAMm_X85vz1AG | 8129 | Sort the values of an nD array | 39069044 | open | 0 | 11 | 2023-08-31T16:20:40Z | 2023-09-01T15:37:34Z | CONTRIBUTOR | Is your feature request related to a problem?As far as I know, there is no straightforward API in xarray to do what Describe the solution you'd likeWould there be interest in implementing a Note: this 1D example is not really relevant, see the 2D version and more obvious implementation in comments below for what I really want.
The goal is to handle arrays that we want to monotize like so: ```python da = xr.DataArray([1, 3, 2, 4], coords={"x": [1, 2, 3, 4]}) da.sort_values("x") <xarray.DataArray (x: 4)>
array([1, 2, 3, 4])
Coordinates:
* x (x) int64 1 2 3 4
```
In addition to ```python da = xr.DataArray([1, 3, 2, 4], coords={"x": [1, 3, 2, 4]}) da.sortby("x") <xarray.DataArray (x: 4)> array([1, 2, 3, 4]) Coordinates: * x (x) int64 1 2 3 4 ``` Describe alternatives you've consideredI don't know if Additional contextSome past related threads on this topic: https://github.com/pydata/xarray/issues/3957 https://stackoverflow.com/questions/64518239/sorting-dataset-along-axis-with-dask |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/8129/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |