🍾 Xarray is now 10 years old! 🎉

xarray.core.coordinates.DatasetCoordinates.to_index

xarray.core.coordinates.DatasetCoordinates.to_index#

DatasetCoordinates.to_index(ordered_dims=None)[source]#

Convert all index coordinates into a pandas.Index.

Parameters:

ordered_dims (sequence of hashable, optional) – Possibly reordered version of this object’s dimensions indicating the order in which dimensions should appear on the result.

Returns:

pandas.Index – Index subclass corresponding to the outer-product of all dimension coordinates. This will be a MultiIndex if this object is has more than more dimension.