issues: 376953925
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
376953925 | MDU6SXNzdWUzNzY5NTM5MjU= | 2537 | single coordinate is overwritten with dimension by set_index | 5308236 | open | 0 | 8 | 2018-11-02T20:17:54Z | 2020-11-02T17:24:35Z | NONE | Code Sample
Problem descriptionwhen a DataArray is initialized with a dimension containing only one coordinate, selection on the coordinate is not directly possible. As a workaround, we can The DataArrays in my use case are generic, in some cases there are multiple coordinates and sometimes there is only one. If the one consistent coordinate is discarded for some cases, follow-up code becomes tedious.
Having a single-coordinate MultiIndex would be much more intuitive so that one can still Expected Output
For more than one coordinate on the dimension, the dimension becomes a MultiIndex with all the coordinates. With only a single coordinate however, this does not happen. Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2537/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |