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

Method test_concat_multiindex

xarray/tests/test_concat.py:1003–1011  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1001 assert_identical(actual, expected)
1002
1003 def test_concat_multiindex(self) -> None:
1004 midx = pd.MultiIndex.from_product([[1, 2, 3], ["a", "b"]])
1005 midx_coords = Coordinates.from_pandas_multiindex(midx, "x")
1006 expected = Dataset(coords=midx_coords)
1007 actual = concat(
1008 [expected.isel(x=slice(2)), expected.isel(x=slice(2, None))], "x"
1009 )
1010 assert expected.equals(actual)
1011 assert isinstance(actual.x.to_index(), pd.MultiIndex)
1012
1013 def test_concat_along_new_dim_multiindex(self) -> None:
1014 # see https://github.com/pydata/xarray/issues/6881

Callers

nothing calls this directly

Calls 6

iselMethod · 0.95
equalsMethod · 0.95
DatasetClass · 0.90
concatFunction · 0.90
to_indexMethod · 0.45

Tested by

no test coverage detected