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

Function test_nunique

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

Source from the content-addressed store, hash-verified

4837@pytest.mark.parametrize("dropna", [True, False])
4838@pytest.mark.parametrize("axis", [0, 1])
4839def test_nunique(dropna, axis):
4840 df = pd.DataFrame(
4841 {"x": ["a", "a", "c"], "y": [None, 1, 2], "c": np.arange(0, 1, 0.4)}
4842 )
4843 ddf = dd.from_pandas(df, npartitions=2)
4844 assert_eq(ddf["y"].nunique(dropna=dropna), df["y"].nunique(dropna=dropna))
4845 assert_eq(
4846 ddf.nunique(dropna=dropna, axis=axis), df.nunique(dropna=dropna, axis=axis)
4847 )
4848
4849
4850def 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