issue_comments: 1234639080
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/3731#issuecomment-1234639080 | https://api.github.com/repos/pydata/xarray/issues/3731 | 1234639080 | IC_kwDOAMm_X85Jlxjo | 3698640 | 2022-09-01T18:31:08Z | 2022-09-01T18:31:08Z | CONTRIBUTOR | ooh this is a fun one! came across this issue when we stumbled across a pendantic case writing tests (H/T @brews). I expected this to "fail loudly in the constructor" but it doesn't. note that currently AFAICT you cannot use positional slicing to achieve an intuitive result - the behavior seems more undefined/unpredictable ```python setupimport xarray as xr, pandas as pd, numpy as np
da = xr.DataArray(np.arange(8).reshape(2, 2, 2), coords=[[0, 1], [0, 1], ['a', 'b']], dims=["ni", "ni", "shh"])
Coordinates:
* ni (ni) int64 0 1
* shh (shh) <U1 'a' 'b'
Coordinates: * ni (ni) int64 0 1 * shh (shh) <U1 'a' 'b' In [7]: da[:, 0, :] # positional slicing along second dim slices both dims Out[7]: <xarray.DataArray (shh: 2)> array([0, 1]) Coordinates: ni int64 0 * shh (shh) <U1 'a' 'b' ``` |
{ "total_count": 2, "+1": 2, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
557257598 |