issues: 505493879
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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
505493879 | MDU6SXNzdWU1MDU0OTM4Nzk= | 3390 | xarray.DataArray.where always returns array of float64 regardless of input dtype | 6051395 | open | 0 | 12 | 2019-10-10T20:29:26Z | 2021-03-02T02:42:37Z | CONTRIBUTOR | MCVE Code Sampleimport numpy as np import xarray as xr a = xr.DataArray(np.arange(25).reshape(5, 5), dims=('x', 'y')) print(a.dtype) 'int32' a_sub = a.where(a.x + a.y < 4) a_sub.dtype 'float64' Expected Outputa_sub should be an xarray of dtype int32 Problem DescriptionThe documentation (http://xarray.pydata.org/en/stable/generated/xarray.DataArray.where.html) states that return type should be the same type as caller. However, the return type is always float64 Output of
|
{ "url": "https://api.github.com/repos/pydata/xarray/issues/3390/reactions", "total_count": 0, "+1": 0, "-1": 0, "laugh": 0, "hooray": 0, "confused": 0, "heart": 0, "rocket": 0, "eyes": 0 } |
13221727 | issue |