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