issue_comments: 691045790
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/4417#issuecomment-691045790 | https://api.github.com/repos/pydata/xarray/issues/4417 | 691045790 | MDEyOklzc3VlQ29tbWVudDY5MTA0NTc5MA== | 3958036 | 2020-09-11T11:45:40Z | 2020-09-11T11:45:40Z | CONTRIBUTOR | I haven't managed to get ds = xr.Dataset() ds['a'] = ('x', np.linspace(0,1)) ds['b'] = ('x', np.linspace(3,4)) ds = ds.rename(b='x') ds = ds.set_coords('x') ds = ds.set_index(x='x') print(ds)
print('indexes', ds.indexes)
One suggested solution in #2461 was to use ds = xr.Dataset() ds['a'] = ('x', np.linspace(0,1)) ds['b'] = ('x', np.linspace(3,4)) ds = ds.swap_dims({'x': 'b'}) ds = ds.rename(b='x') print(ds)
print('indexes', ds.indexes)
I found the behaviour confusing because I wasn't aware of the index variables at all... I create a coordinate with I may well be missing other context that makes this an undesirable thing to do, but for my use-case at least, I think it would make more sense if |
{ "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
698577111 |