issue_comments: 1199194614
This data as json
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/6835#issuecomment-1199194614 | https://api.github.com/repos/pydata/xarray/issues/6835 | 1199194614 | IC_kwDOAMm_X85HekH2 | 4160723 | 2022-07-29T11:59:40Z | 2022-07-29T11:59:40Z | MEMBER | Thanks for the report @momchil-flex. That's definitely a regression. However, I wonder what should we do: depreciate interpreting tuples as sequences and always consider them as "scalar" values or continue interpreting it differently depending on the cases? For example, tuples indexer values were (and still are) assumed to be single element values when selecting on a dimension coordinate with a multi-index (although eventually the multi-index dimension coordinate might be depreciated in xarray): ```python da = xr.DataArray( data=range(3), dims="x", coords={"a": ("x", ["a", "a", "c"]), "b": ("x", [0, 1, 2])}, ).set_index(x=["a", "b"]) da <xarray.DataArray (x: 3)>array([0, 1, 2])Coordinates:* x (x) object MultiIndex* a (x) <U1 'a' 'a' 'c'* b (x) int64 0 1 2da.sel(x=("a", 1)) <xarray.DataArray ()>array(1)Coordinates:x object ('a', 1)a <U1 'a'b int64 1``` Pros of always treating a tuple as 1-element indexer value:
Cons:
|
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
1318826485 |