# xarray.Dataset.reorder_levels

#### Dataset.reorder_levels(dim_order=None, \*\*dim_order_kwargs)[[source]](https://github.com/pydata/xarray/blob/main/xarray/core/dataset.py#L5209-L5256)

Rearrange index levels using input order.

* **Parameters:**
  * **dim_order** ([dict-like](https://docs.python.org/3/glossary.html#term-mapping) of `Hashable` to `Sequence` of [`int`](https://docs.python.org/3/builtins/functions.html#int) or `Hashable`, *optional*) – Mapping from names matching dimensions and values given
    by lists representing new level orders. Every given dimension
    must have a multi-index.
  * **\*\*dim_order_kwargs** (`Sequence` of [`int`](https://docs.python.org/3/builtins/functions.html#int) or `Hashable`, *optional*) – The keyword arguments form of `dim_order`.
    One of dim_order or dim_order_kwargs must be provided.
* **Returns:**
  **obj** ([`Dataset`](xarray.Dataset.html.md#xarray.Dataset)) – Another dataset, with this dataset’s data but replaced
  coordinates.
