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

Method test_copy

xarray/tests/test_indexes.py:548–560  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

546 assert new_index.level_coords_dtype == level_coords_dtype
547
548 def test_copy(self) -> None:
549 level_coords_dtype = {"one": "U<1", "two": np.int32}
550 expected = PandasMultiIndex(
551 pd.MultiIndex.from_product([["a", "b"], [1, 2]], names=("one", "two")),
552 "x",
553 level_coords_dtype=level_coords_dtype,
554 )
555 actual = expected.copy()
556
557 assert actual.index.equals(expected.index)
558 assert actual.index is not expected.index
559 assert actual.dim == expected.dim
560 assert actual.level_coords_dtype == expected.level_coords_dtype
561
562
563class TestIndexes:

Callers

nothing calls this directly

Calls 3

PandasMultiIndexClass · 0.90
copyMethod · 0.45
equalsMethod · 0.45

Tested by

no test coverage detected