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

Function test_drop_duplicates_subset

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

Source from the content-addressed store, hash-verified

1118
1119
1120def test_drop_duplicates_subset():
1121 df = pd.DataFrame({"x": [1, 2, 3, 1, 2, 3], "y": ["a", "a", "b", "b", "c", "c"]})
1122 ddf = dd.from_pandas(df, npartitions=2)
1123
1124 for kwarg in [{"keep": "first"}, {"keep": "last"}]:
1125 assert_eq(df.x.drop_duplicates(**kwarg), ddf.x.drop_duplicates(**kwarg))
1126 for ss in [["x"], "y", ["x", "y"]]:
1127 assert_eq(
1128 df.drop_duplicates(subset=ss, **kwarg),
1129 ddf.drop_duplicates(subset=ss, **kwarg),
1130 )
1131 assert_eq(df.drop_duplicates(ss, **kwarg), ddf.drop_duplicates(ss, **kwarg))
1132
1133
1134def 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