issues: 342426261
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
342426261 | MDU6SXNzdWUzNDI0MjYyNjE= | 2299 | Confusing behaviour with MultiIndex | 1882397 | closed | 0 | 6815844 | 1 | 2018-07-18T17:41:12Z | 2018-08-13T22:16:31Z | 2018-08-13T22:16:31Z | NONE |
```python a = pd.DataFrame({'a': [1, 2], 'b': [3, 4]}).unstack('a') a.index.names = ['dim0', 'dim1'] a.index.name = 'stacked_dim' b = xr.Dataset(coords={'dim0': ['a', 'b'], 'dim1': [0, 1]}) b = b.stack(dim_stacked=['dim0', 'dim1']) assert(len(b.dim0) == 4) This should raise an errors because the length is != 4b['c'] = (('dim0',), [10, 11])
b
Similar cases of coordinates that aren't used do raise an error:
Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/2299/reactions", "total_count": 1, "+1": 1, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |