-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
bugneeds triageIssue that has not been reviewed by xarray team memberIssue that has not been reviewed by xarray team member
Description
What happened?
import xarray as xr
x = xr.DataArray(np.zeros((2, 3)), dims=("a", "b"))
assert x[("b", np.array([0, 1, 0])),].shape == (3,)
x[("b", np.array([0, 1, 0])),] += 1 # ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 1 dimensions. The detected shape was (2,) + inhomogeneous part.
Under the hood, this ends up being called, which fails:
x.variable[("b", np.array([0, 1, 0])),]
Metadata
Metadata
Assignees
Labels
bugneeds triageIssue that has not been reviewed by xarray team memberIssue that has not been reviewed by xarray team member