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

Function test_groupby_callable

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

Source from the content-addressed store, hash-verified

3512
3513
3514def test_groupby_callable():
3515 a = pd.DataFrame({"x": [1, 2, 3, None], "y": [10, 20, 30, 40]}, index=[1, 2, 3, 4])
3516 b = dd.from_pandas(a, 2)
3517
3518 def iseven(x):
3519 return x % 2 == 0
3520
3521 assert_eq(a.groupby(iseven).y.sum(), b.groupby(iseven).y.sum())
3522 assert_eq(a.y.groupby(iseven).sum(), b.y.groupby(iseven).sum())
3523
3524
3525def test_methods_tokenize_differently():

Callers

nothing calls this directly

Calls 4

groupbyMethod · 0.95
assert_eqFunction · 0.90
sumMethod · 0.45
groupbyMethod · 0.45

Tested by

no test coverage detected