issues: 219043002
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
219043002 | MDU6SXNzdWUyMTkwNDMwMDI= | 1350 | where(..., drop=True) error | 4295853 | closed | 0 | 2444330 | 4 | 2017-04-03T19:53:33Z | 2017-04-14T03:50:53Z | 2017-04-14T03:50:53Z | CONTRIBUTOR | These results appear to be incorrect unless I'm missing something: ```python In [1]: import xarray as xr In [2]: import numpy as np In [3]: array = xr.DataArray(np.zeros((1,2,3)), dims=['time','x','y'], coords={'x':np.arange(2)}) In [4]: array[0,1,1] = 1 In [5]: array.where(array !=0, drop=True) Out[5]: <xarray.DataArray (time: 1, x: 1, y: 1)> array([[[ 0.]]]) Coordinates: * x (x) int64 1 Dimensions without coordinates: time, y In [5]: array.where(array !=0, drop=True).values Out[5]: array([[[ 0.]]]) In [7]: array.values[array.values !=0] Out[7]: array([ 1.]) ``` |
{ "url": "https://api.github.com/repos/pydata/xarray/issues/1350/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
completed | 13221727 | issue |