MCPcopy Create free account
hub / github.com/dask/dask / test_abs

Function test_abs

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
absMethod · 0.45

Tested by

no test coverage detected