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

Method test_join

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

Source from the content-addressed store, hash-verified

510 index.sel({"x": (slice(None), 1, "no_level")})
511
512 def test_join(self):
513 midx = pd.MultiIndex.from_product([["a", "aa"], [1, 2]], names=("one", "two"))
514 level_coords_dtype = {"one": "=U2", "two": "i"}
515 index1 = PandasMultiIndex(midx, "x", level_coords_dtype=level_coords_dtype)
516 index2 = PandasMultiIndex(midx[0:2], "x", level_coords_dtype=level_coords_dtype)
517
518 actual = index1.join(index2)
519 assert actual.equals(index2)
520 assert actual.level_coords_dtype == level_coords_dtype
521
522 actual = index1.join(index2, how="outer")
523 assert actual.equals(index1)
524 assert actual.level_coords_dtype == level_coords_dtype
525
526 def test_rename(self) -> None:
527 level_coords_dtype = {"one": "<U1", "two": np.int32}

Callers

nothing calls this directly

Calls 3

joinMethod · 0.95
PandasMultiIndexClass · 0.90
equalsMethod · 0.45

Tested by

no test coverage detected