🍾 Xarray is now 10 years old! 🎉

xarray.Index.from_variables

xarray.Index.from_variables#

classmethod Index.from_variables(variables, *, options)[source]#

Create a new index object from one or more coordinate variables.

This factory method must be implemented in all subclasses of Index.

The coordinate variables may be passed here in an arbitrary number and order and each with arbitrary dimensions. It is the responsibility of the index to check the consistency and validity of these coordinates.

Parameters:

variables (dict-like) – Mapping of Variable objects holding the coordinate labels to index.

Returns:

index (Index) – A new Index object.