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

Function test_value_counts_with_normalize

dask/dataframe/tests/test_dataframe.py:1209–1222  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1207
1208
1209def test_value_counts_with_normalize():
1210 df = pd.DataFrame({"x": [1, 2, 1, 3, 3, 1, 4]})
1211 ddf = dd.from_pandas(df, npartitions=3)
1212 result = ddf.x.value_counts(normalize=True)
1213 expected = df.x.value_counts(normalize=True)
1214 assert_eq(result, expected)
1215
1216 result2 = ddf.x.value_counts(split_every=2, normalize=True)
1217 assert_eq(result2, expected)
1218 assert result._name != result2._name
1219
1220 result3 = ddf.x.value_counts(split_out=2, normalize=True)
1221 assert_eq(result3, expected)
1222 assert result._name != result3._name
1223
1224
1225@pytest.mark.parametrize("normalize", [True, False])

Callers

nothing calls this directly

Calls 2

assert_eqFunction · 0.90
value_countsMethod · 0.45

Tested by

no test coverage detected