MCPcopy
hub / github.com/dask/dask / test_abs

Function test_abs

dask/dataframe/tests/test_dataframe.py:2974–2989  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2972
2973
2974def test_abs():
2975 df = pd.DataFrame(
2976 {
2977 "A": [1, -2, 3, -4, 5],
2978 "B": [-6.0, -7, -8, -9, 10],
2979 "C": ["a", "b", "c", "d", "e"],
2980 }
2981 )
2982 ddf = dd.from_pandas(df, npartitions=2)
2983 assert_eq(ddf.A.abs(), df.A.abs())
2984 assert_eq(ddf[["A", "B"]].abs(), df[["A", "B"]].abs())
2985 # raises TypeError with object dtype, but NotImplementedError with string[pyarrow]
2986 with pytest.raises((TypeError, NotImplementedError, ValueError)):
2987 ddf.C.abs()
2988 with pytest.raises((TypeError, NotImplementedError)):
2989 ddf.abs()
2990
2991
2992def test_round():

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
absMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…