-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
xarray.merge exception : invalid type promotion #1952
Comments
Thanks for the clear report! This seems to boil down to an issue with
The source problem seems to be that numpy consider timedelta64 an integer subclass (?!?):
|
It looks like the simple fix is to reorder the check for timedelta64 in promote_dtype to be above the check for integer. Any interest in putting together a PR? :) |
Fixing
|
I think that warning can be safely ignored in this case, but yes, that should also probably be silenced (see also #1652). |
Code Sample
Problem description
Merging arrays with identical dtypes should work ...
There's some issue with the
NaT
being interpreted as float64, so thatxarray.core.dtypes.result_type
thinks that those 2 arrays are not compatible..It works with
xarray==0.10.0
and fails atxarray==0.10.1
.I've pin-pointed the issue to commit 2aa5b8a.
Work-around in the mean time :
Expected Output
Output of
xr.show_versions()
xarray: 0.10.0+dev60.g2aa5b8a
pandas: 0.22.0
numpy: 1.14.0
scipy: None
netCDF4: 1.3.1
h5netcdf: None
h5py: None
Nio: None
zarr: None
bottleneck: None
cyordereddict: None
dask: None
distributed: None
matplotlib: 2.1.1
cartopy: None
seaborn: None
setuptools: 38.4.0
pip: 9.0.1
conda: None
pytest: 3.3.2
IPython: 6.2.1
sphinx: None
Thanks !
The text was updated successfully, but these errors were encountered: