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

Function test_quantile

dask/dataframe/dask_expr/tests/test_collection.py:2322–2339  ·  view source on GitHub ↗
(df)

Source from the content-addressed store, hash-verified

2320
2321
2322def test_quantile(df):
2323 assert_eq(df.x.quantile(), 49.0)
2324 assert_eq(df.x.quantile(method="dask"), 49.0)
2325 assert_eq(
2326 df.x.quantile(q=[0.2, 0.8]),
2327 pd.Series([19.0, 79.0], index=[0.2, 0.8], name="x"),
2328 )
2329 assert_eq(
2330 df.x.index.quantile(q=[0.2, 0.8]),
2331 pd.Series([19.0, 79.0], index=[0.2, 0.8]),
2332 )
2333
2334 with pytest.raises(AssertionError):
2335 df.x.quantile(q=[]).compute()
2336
2337 ser = from_pandas(pd.Series(["a", "b", "c"]), npartitions=2)
2338 with pytest.raises(ValueError, match="not supported with string|object series"):
2339 ser.quantile()
2340
2341
2342@pytest.mark.parametrize("join", ["inner", "outer", "left", "right"])

Callers

nothing calls this directly

Calls 4

assert_eqFunction · 0.90
from_pandasFunction · 0.90
quantileMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected