You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
Input In [13], in <module>
10 broadcasted, _ = xr.broadcast(stacked, stacked.space)
11 stacked.sum("z").unstack("space")
---> 12 broadcasted.sum("z").unstack("space")
File ~/work/python/xarray/xarray/core/dataset.py:4332, in Dataset.unstack(self, dim, fill_value, sparse)
4330 non_multi_dims = set(dims) - set(stacked_indexes)
4331 if non_multi_dims:
-> 4332 raise ValueError(
4333 "cannot unstack dimensions that do not "
4334 f"have exactly one multi-index: {tuple(non_multi_dims)}"
4335 )
4337 result = self.copy(deep=False)
4339 # we want to avoid allocating an object-dtype ndarray for a MultiIndex,
4340 # so we can't just access self.variables[v].data for every variable.
4341 # We only check the non-index variables.
4342 # https://github.com/pydata/xarray/issues/5902
ValueError: cannot unstack dimensions that do not have exactly one multi-index: ('space',)
What did you expect to happen?
This should work.
Minimal Complete Verifiable Example
No response
Relevant log output
No response
Anything else we need to know?
No response
Environment
xarray main after the flexible indexes refactor
The text was updated successfully, but these errors were encountered:
What happened?
What did you expect to happen?
This should work.
Minimal Complete Verifiable Example
No response
Relevant log output
No response
Anything else we need to know?
No response
Environment
xarray main after the flexible indexes refactor
The text was updated successfully, but these errors were encountered: