MCPcopy Index your code
hub / github.com/pydata/xarray / test_to_index

Method test_to_index

xarray/tests/test_variable.py:2570–2573  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2568 IndexVariable((), 0)
2569
2570 def test_to_index(self):
2571 data = 0.5 * np.arange(10)
2572 v = IndexVariable(["time"], data, {"foo": "bar"})
2573 assert pd.Index(data, name="time").identical(v.to_index())
2574
2575 def test_to_index_multiindex_level(self):
2576 midx = pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=("one", "two"))

Callers

nothing calls this directly

Calls 4

to_indexMethod · 0.95
IndexVariableClass · 0.90
arangeMethod · 0.80
identicalMethod · 0.45

Tested by

no test coverage detected