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

Function test_get_dummies_empty

xarray/tests/test_accessor_str.py:3044–3051  ·  view source on GitHub ↗
(dtype)

Source from the content-addressed store, hash-verified

3042
3043
3044def test_get_dummies_empty(dtype) -> None:
3045 values = xr.DataArray([], dims=["X"]).astype(dtype)
3046 expected = xr.DataArray(np.zeros((0, 0)), dims=["X", "ZZ"]).astype(dtype)
3047
3048 res = values.str.get_dummies(dim="ZZ")
3049
3050 assert res.dtype == expected.dtype
3051 assert_equal(res, expected)
3052
3053
3054def test_splitters_empty_str(dtype) -> None:

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
get_dummiesMethod · 0.80
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…