# xarray.Variable.unstack

#### Variable.unstack(dim=None, \*\*dim_kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/variable.py#L1908-L1945)

Unstack an existing dimension into multiple new dimensions.

New dimensions will be added at the end, and the order of the data
along each new dimension will be in contiguous (C) order.

Note that unlike `DataArray.unstack` and `Dataset.unstack`, this
method requires the existing dimension to contain the full product of
the new dimensions.

* **Parameters:**
  * **dim** ([mapping](https://docs.python.org/3/glossary.html#term-mapping) of [hashable](../user-guide/terminology.html.md#term-name) to [mapping](https://docs.python.org/3/glossary.html#term-mapping) of [hashable](../user-guide/terminology.html.md#term-name) to [`int`](https://docs.python.org/3/builtins/functions.html#int)) – Mapping of the form old_dim={dim1: size1, …} describing the
    names of existing dimensions, and the new dimensions and sizes
    that they map to.
  * **\*\*dim_kwargs** – The keyword arguments form of `dim`.
    One of dim or dim_kwargs must be provided.
* **Returns:**
  **unstacked** ([`Variable`](xarray.Variable.html.md#xarray.Variable)) – Variable with the same attributes but unstacked data.

#### SEE ALSO
[`Variable.stack`](xarray.Variable.stack.html.md#xarray.Variable.stack), [`DataArray.unstack`](xarray.DataArray.unstack.html.md#xarray.DataArray.unstack), [`Dataset.unstack`](xarray.Dataset.unstack.html.md#xarray.Dataset.unstack)
