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

Function test_resample_apis

dask/dataframe/tseries/tests/test_resample_expr.py:54–69  ·  view source on GitHub ↗
(df, pdf, api, kwargs)

Source from the content-addressed store, hash-verified

52 ],
53)
54def test_resample_apis(df, pdf, api, kwargs):
55 result = getattr(df.resample("2min", **kwargs), api)()
56 expected = getattr(pdf.resample("2min", **kwargs), api)()
57 assert_eq(result, expected)
58
59 # No column output
60 if api != "size":
61 result = getattr(df.resample("2min"), api)()["foo"]
62 expected = getattr(pdf.resample("2min"), api)()["foo"]
63 assert_eq(result, expected)
64
65 if api != "ohlc":
66 # ohlc actually gives back a DataFrame, so this doesn't work
67 q = result.simplify()
68 eq = getattr(df["foo"].resample("2min"), api)().simplify()
69 assert q._name == eq._name
70
71
72@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

assert_eqFunction · 0.90
resampleMethod · 0.80
simplifyMethod · 0.45

Tested by

no test coverage detected