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

Function test_drop_duplicates_subset

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

Source from the content-addressed store, hash-verified

1100
1101
1102def test_drop_duplicates_subset():
1103 df = pd.DataFrame({"x": [1, 2, 3, 1, 2, 3], "y": ["a", "a", "b", "b", "c", "c"]})
1104 ddf = dd.from_pandas(df, npartitions=2)
1105
1106 for kwarg in [{"keep": "first"}, {"keep": "last"}]:
1107 assert_eq(df.x.drop_duplicates(**kwarg), ddf.x.drop_duplicates(**kwarg))
1108 for ss in [["x"], "y", ["x", "y"]]:
1109 assert_eq(
1110 df.drop_duplicates(subset=ss, **kwarg),
1111 ddf.drop_duplicates(subset=ss, **kwarg),
1112 )
1113 assert_eq(df.drop_duplicates(ss, **kwarg), ddf.drop_duplicates(ss, **kwarg))
1114
1115
1116def test_get_partition():

Callers

nothing calls this directly

Calls 3

drop_duplicatesMethod · 0.95
assert_eqFunction · 0.90
drop_duplicatesMethod · 0.45

Tested by

no test coverage detected