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 met
(self, dim=None, **dim_kwargs)
| 1668 | |
| 1669 | @partial(deprecate_dims, old_name="dimensions") |
| 1670 | def unstack(self, dim=None, **dim_kwargs) -> Variable: |
| 1671 | """ |
| 1672 | Unstack an existing dimension into multiple new dimensions. |
| 1673 | |
| 1674 | New dimensions will be added at the end, and the order of the data |
| 1675 | along each new dimension will be in contiguous (C) order. |
| 1676 | |
| 1677 | Note that unlike ``DataArray.unstack`` and ``Dataset.unstack``, this |
| 1678 | method requires the existing dimension to contain the full product of |
| 1679 | the new dimensions. |
| 1680 | |
| 1681 | Parameters |
| 1682 | ---------- |
| 1683 | dim : mapping of hashable to mapping of hashable to int |
| 1684 | Mapping of the form old_dim={dim1: size1, ...} describing the |
| 1685 | names of existing dimensions, and the new dimensions and sizes |
| 1686 | that they map to. |
| 1687 | **dim_kwargs |
| 1688 | The keyword arguments form of ``dim``. |
| 1689 | One of dim or dim_kwargs must be provided. |
| 1690 | |
| 1691 | Returns |
| 1692 | ------- |
| 1693 | unstacked : Variable |
| 1694 | Variable with the same attributes but unstacked data. |
| 1695 | |
| 1696 | See Also |
| 1697 | -------- |
| 1698 | Variable.stack |
| 1699 | DataArray.unstack |
| 1700 | Dataset.unstack |
| 1701 | """ |
| 1702 | dim = either_dict_or_kwargs(dim, dim_kwargs, "unstack") |
| 1703 | result = self |
| 1704 | for old_dim, dims in dim.items(): |
| 1705 | result = result._unstack_once_full(dims, old_dim) |
| 1706 | return result |
| 1707 | |
| 1708 | def fillna(self, value): |
| 1709 | return ops.fillna(self, value) |