xarray.Dataset.unstack

Dataset.unstack(dim=None, fill_value=<NA>, sparse=False)

Unstack existing dimensions corresponding to MultiIndexes into multiple new dimensions.

New dimensions will be added at the end.

Parameters
  • dim (Hashable or iterable of Hashable, optional) – Dimension(s) over which to unstack. By default unstacks all MultiIndexes.

  • fill_value (value to be filled. By default, np.nan) –

  • sparse (use sparse-array if True) –

Returns

unstacked – Dataset with unstacked data.

Return type

Dataset

See also

Dataset.stack()