xarray.Dataset.unstack (original) (raw)
Dataset.unstack(dim=None, *, fill_value=, sparse=False)[source]#
Unstack existing dimensions corresponding to MultiIndexes into multiple new dimensions.
New dimensions will be added at the end.
Parameters:
- dim (str,
Iterable
ofHashable
or None, optional) – Dimension(s) over which to unstack. By default unstacks all MultiIndexes. - fill_value (scalar or dict-like, default:
nan
) – value to be filled. If a dict-like, maps variable names to fill values. If not provided or if the dict-like does not contain all variables, the dtype’s NA value will be used. - sparse (bool, default: False) – use sparse-array if True
Returns:
unstacked (Dataset) – Dataset with unstacked data.