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

Function test_abs

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

Source from the content-addressed store, hash-verified

2963
2964
2965def test_abs():
2966 df = pd.DataFrame(
2967 {
2968 "A": [1, -2, 3, -4, 5],
2969 "B": [-6.0, -7, -8, -9, 10],
2970 "C": ["a", "b", "c", "d", "e"],
2971 }
2972 )
2973 ddf = dd.from_pandas(df, npartitions=2)
2974 assert_eq(ddf.A.abs(), df.A.abs())
2975 assert_eq(ddf[["A", "B"]].abs(), df[["A", "B"]].abs())
2976 # raises TypeError with object dtype, but NotImplementedError with string[pyarrow]
2977 with pytest.raises((TypeError, NotImplementedError, ValueError)):
2978 ddf.C.abs()
2979 with pytest.raises((TypeError, NotImplementedError)):
2980 ddf.abs()
2981
2982
2983def test_round():

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
absMethod · 0.45

Tested by

no test coverage detected