-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Comparison with masked array yields object-array with nans for masked values #1792
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Yes, I suppose we can consider this a bug. The right behavior would be to convert the masked array into an xarray object before the operation, e.g.,
We currently don't have any masked array specific logic for arithmetic so this would require special case handling. |
See also: #2377. |
Add a workaround for pydata/xarray#1792 --- the mask was accidentally being turned into an object dtype array.
Add a workaround for pydata/xarray#1792 --- the mask was accidentally being turned into an object dtype array.
Add a workaround for pydata/xarray#1792 --- the mask was accidentally being turned into an object dtype array.
Add a workaround for pydata/xarray#1792 --- the mask was accidentally being turned into an object dtype array.
Add a workaround for pydata/xarray#1792 --- the mask was accidentally being turned into an object dtype array.
Add a workaround for pydata/xarray#1792 --- the mask was accidentally being turned into an object dtype array.
In order to maintain a list of currently relevant issues, we mark issues as stale after a period of inactivity If this issue remains relevant, please comment here or remove the |
Code Sample, a copy-pastable example if possible
Problem description
A comparison between a
DataArray
and amasked_array
results in an array with dtypeobject
instead of an array with dtypebool
. This is problematic, because code should be able to assume thatx > y
returns something with abool
dtype.Expected Output
I would expect the masked array to be dropped (which it is) and an array to be returned equivalent to the comparison
da>ma.data
Output of
xr.show_versions()
xarray: 0.10.0+dev12.gf882a58
pandas: 0.21.0
numpy: 1.13.3
scipy: 1.0.0
netCDF4: 1.3.1
h5netcdf: None
Nio: None
bottleneck: 1.2.1
cyordereddict: None
dask: 0.16.0
matplotlib: 2.1.0
cartopy: None
seaborn: 0.8.1
setuptools: 38.2.4
pip: 9.0.1
conda: 4.3.16
pytest: 3.1.2
IPython: 6.1.0
sphinx: 1.6.2
None
The text was updated successfully, but these errors were encountered: