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

Function test_nunique_approx

dask/dataframe/dask_expr/tests/test_collection.py:1979–1989  ·  view source on GitHub ↗
(df, pdf)

Source from the content-addressed store, hash-verified

1977
1978@xfail_gpu("compute_hll_array doesn't work for cudf")
1979def test_nunique_approx(df, pdf):
1980 actual = df.nunique_approx().compute()
1981 assert 99 < actual < 101
1982
1983 actual = df.y.nunique_approx().compute()
1984 expect = pdf.y.nunique()
1985 assert expect * 0.99 < actual < expect * 1.01
1986
1987 actual = df.set_index("y").index.nunique_approx().compute()
1988 expect = pdf.set_index("y").index.nunique()
1989 assert expect * 0.99 < actual < expect * 1.01
1990
1991
1992def test_memory_usage_per_partition(df):

Callers

nothing calls this directly

Calls 4

set_indexMethod · 0.80
computeMethod · 0.45
nunique_approxMethod · 0.45
nuniqueMethod · 0.45

Tested by

no test coverage detected