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

Method test_categorical_multiindex

xarray/tests/test_dataset.py:1968–1977  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1966 align(res, test, join="exact")
1967
1968 def test_categorical_multiindex(self) -> None:
1969 i1 = pd.Series([0, 0])
1970 cat = pd.CategoricalDtype(categories=["foo", "baz", "bar"])
1971 i2 = pd.Series(["baz", "bar"], dtype=cat)
1972
1973 df = pd.DataFrame({"i1": i1, "i2": i2, "values": [1, 2]}).set_index(
1974 ["i1", "i2"]
1975 )
1976 actual = df.to_xarray()
1977 assert actual["values"].shape == (1, 2)
1978
1979 def test_sel_drop(self) -> None:
1980 data = Dataset({"foo": ("x", [1, 2, 3])}, {"x": [0, 1, 2]})

Callers

nothing calls this directly

Calls 1

set_indexMethod · 0.45

Tested by

no test coverage detected