classmethod Index.stack(variables, dim)[source]#

Create a new index by stacking coordinate variables into a single new dimension.

Implementation is optional but required in order to support stack. Otherwise it will raise an error when trying to pass the Index subclass as argument to Dataset.stack().

  • variables (dict-like) – Mapping of Variable objects to stack together.

  • dim (Hashable) – Name of the new, stacked dimension.


index – A new Index object.