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

Function test_slice_broadcast

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

Source from the content-addressed store, hash-verified

2177
2178
2179def test_slice_broadcast(dtype) -> None:
2180 arr = xr.DataArray(["aafootwo", "aabartwo", "aabazqux"]).astype(dtype)
2181 start = xr.DataArray([1, 2, 3])
2182 stop = 5
2183
2184 result = arr.str.slice(start=start, stop=stop)
2185 exp = xr.DataArray(["afoo", "bar", "az"]).astype(dtype)
2186 assert result.dtype == exp.dtype
2187 assert_equal(result, exp)
2188
2189
2190def test_slice_replace(dtype) -> None:

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
astypeMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…