๐Ÿพ Xarray is now 10 years old! ๐ŸŽ‰

xarray.Coordinates.from_pandas_multiindex

xarray.Coordinates.from_pandas_multiindex#

classmethod Coordinates.from_pandas_multiindex(midx, dim)[source]#

Wrap a pandas multi-index as Xarray coordinates (dimension + levels).

The returned coordinates can be directly assigned to a Dataset or DataArray via the coords argument of their constructor.

Parameters:
Returns:

coords (Coordinates) โ€“ A collection of Xarray indexed coordinates created from the multi-index.