stack — xarray_extras 0.6.1.dev7+g2fd6faf.d20250305 documentation (original) (raw)


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:

Returns:

xarray.DataArray or xarray.Dataset with unstacked dimension