-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
DataArray.expand_dims
with the new coords passed as keyword arguments recently broke in pandas nightly.
import xarray
ab = xarray.DataArray([1, 2], dims=['x'], coords={'x': ['a', 'b']})
c = xarray.DataArray(3).expand_dims(x=["c"])
# c.coords["x"] = c.coords["x"].values
arr = xarray.concat([ab, c], dim="x")
crashes with
TypeError: Cannot interpret '<StringDtype(storage='python', na_value=nan)>' as a data type
Uncommenting the third line, which overwrites the coord with a numpy array copy of itself, works around the problem.
It broke somewhere between 3.0.0.dev0+2231 and 3.0.0.dev0+2248; I did not bisect it exactly.