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

Function test_nunique

dask/dataframe/tests/test_dataframe.py:4864–4872  ·  view source on GitHub ↗
(dropna, axis)

Source from the content-addressed store, hash-verified

4862@pytest.mark.parametrize("dropna", [True, False])
4863@pytest.mark.parametrize("axis", [0, 1])
4864def test_nunique(dropna, axis):
4865 df = pd.DataFrame(
4866 {"x": ["a", "a", "c"], "y": [None, 1, 2], "c": np.arange(0, 1, 0.4)}
4867 )
4868 ddf = dd.from_pandas(df, npartitions=2)
4869 assert_eq(ddf["y"].nunique(dropna=dropna), df["y"].nunique(dropna=dropna))
4870 assert_eq(
4871 ddf.nunique(dropna=dropna, axis=axis), df.nunique(dropna=dropna, axis=axis)
4872 )
4873
4874
4875def test_iter():

Callers

nothing calls this directly

Calls 4

nuniqueMethod · 0.95
assert_eqFunction · 0.90
arangeMethod · 0.45
nuniqueMethod · 0.45

Tested by

no test coverage detected