xarray.DataArray.reorder_levels#
- DataArray.reorder_levels(dim_order=None, **dim_order_kwargs)[source]#
Rearrange index levels using input order.
- Parameters
dim_order dict-like of Hashable to 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 (optional) – The keyword arguments form of
dim_order
. One of dim_order or dim_order_kwargs must be provided.
- Returns
obj (
DataArray
) – Another dataarray, with this dataarray’s data but replaced coordinates.