MCPcopy
hub / github.com/pydata/xarray / to_index_variable

Method to_index_variable

xarray/core/variable.py:569–573  ·  view source on GitHub ↗

Return this variable as an xarray.IndexVariable

(self)

Source from the content-addressed store, hash-verified

567 to_variable = utils.alias(to_base_variable, "to_variable")
568
569 def to_index_variable(self) -> IndexVariable:
570 """Return this variable as an xarray.IndexVariable"""
571 return IndexVariable(
572 self._dims, self._data, self._attrs, encoding=self._encoding, fastpath=True
573 )
574
575 to_coord = utils.alias(to_index_variable, "to_coord")
576

Callers 8

as_variableFunction · 0.95
_to_indexMethod · 0.95
to_indexMethod · 0.95
test_as_variableMethod · 0.95
swap_dimsMethod · 0.45
_infer_coords_and_dimsFunction · 0.45

Calls 1

IndexVariableClass · 0.85

Tested by 1

test_as_variableMethod · 0.76