# xarray.Dataset.unstack

#### Dataset.unstack(dim=None, \*, fill_value=<NA>, sparse=False)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/dataset.py#L5637-L5738)

Unstack existing dimensions corresponding to MultiIndexes into
multiple new dimensions.

New dimensions will be added at the end.

* **Parameters:**
  * **dim** ([`str`](https://docs.python.org/3/builtins/stdtypes.html#str), `Iterable` of `Hashable` or [`None`](https://docs.python.org/3/builtins/constants.html#None), *optional*) – Dimension(s) over which to unstack. By default unstacks all
    MultiIndexes.
  * **fill_value** ([scalar](../user-guide/terminology.html.md#term-scalar) or [dict-like](https://docs.python.org/3/glossary.html#term-mapping), *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`](https://docs.python.org/3/builtins/functions.html#bool), *default*: [`False`](https://docs.python.org/3/builtins/constants.html#False)) – use sparse-array if True
* **Returns:**
  **unstacked** ([`Dataset`](xarray.Dataset.html.md#xarray.Dataset)) – Dataset with unstacked data.

#### SEE ALSO
[`Dataset.stack`](xarray.Dataset.stack.html.md#xarray.Dataset.stack)
