issues: 564555854
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
564555854 | MDU6SXNzdWU1NjQ1NTU4NTQ= | 3768 | Pointwise indexing | 8238804 | closed | 0 | 6 | 2020-02-13T09:39:27Z | 2021-02-16T23:37:29Z | 2021-02-16T23:37:29Z | NONE | MCVE Code Sample```python import xarray as xr import numpy as np da = xr.DataArray( np.arange(56).reshape((7, 8)), coords={ 'x': list('abcdefg'), 'y': 10 * np.arange(8) }, dims=['x', 'y'] ) Shouldn't this be (2,)?assert da.isel(x=[0, 1], y=[0, 1]).shape == (2, 2) ``` Expected OutputI had expected Problem DescriptionGoing off this example in #507:
and the deprecation of This was made a little bit more confusing by the documentation for setting values by index. In particular the example: ```python In [68]: da[ind_x, ind_y] = -2 # assign -2 to (ix, iy) = (0, 0) and (1, 1) In [69]: da Out[69]: <xarray.DataArray (x: 3, y: 4)> array([[-2, -2, -1, -1], [-2, -2, 6, 7], [ 8, 9, 10, 11]]) ``` To me, the comment All in all, I'm not sure if this is a bug, or an issue with documentation. If Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3768/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |