MCPcopy
hub / github.com/pydata/xarray / test_len

Function test_len

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

Source from the content-addressed store, hash-verified

1760
1761
1762def test_len(dtype) -> None:
1763 values = ["foo", "fooo", "fooooo", "fooooooo"]
1764 result = xr.DataArray(values).astype(dtype).str.len()
1765 expected = xr.DataArray([len(x) for x in values])
1766 assert result.dtype == expected.dtype
1767 assert_equal(result, expected)
1768
1769
1770def test_find(dtype) -> None:

Callers

nothing calls this directly

Calls 3

assert_equalFunction · 0.90
lenMethod · 0.80
astypeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…