stack — xarray_extras 0.6.1.dev7+g2fd6faf.d20250305 documentation (original) (raw)
- stack
- View page source
Utilities for stacking/unstacking dimensions
xarray_extras.stack.proper_unstack(array: T, dim: Hashable) → T
Work around an issue in xarray that causes the data to be sorted alphabetically by label on unstack():
https://github.com/pydata/xarray/issues/906
Also work around issue that causes string labels to be converted to objects:
https://github.com/pydata/xarray/issues/907
Parameters:
- array – xarray.DataArray or xarray.Dataset to unstack
- dim (str) – Name of existing dimension to unstack
Returns:
xarray.DataArray or xarray.Dataset with unstacked dimension