MCPcopy
hub / github.com/dask/dask / test_unique_base

Function test_unique_base

dask/dataframe/dask_expr/tests/test_reductions.py:217–229  ·  view source on GitHub ↗
(df, pdf)

Source from the content-addressed store, hash-verified

215
216
217def test_unique_base(df, pdf):
218 with pytest.raises(
219 AttributeError, match="'DataFrame' object has no attribute 'unique'"
220 ):
221 df.unique()
222
223 # pandas returns a numpy array while we return a Series/Index
224 assert_eq(df.x.unique(), pd.Series(pdf.x.unique(), name="x"), check_index=False)
225 assert_eq(df.index.unique(split_out=1), pd.Index(pdf.index.unique()))
226 np.testing.assert_array_equal(
227 df.index.unique().compute().sort_values().values,
228 pd.Index(pdf.index.unique()).values,
229 )
230
231
232def test_value_counts_split_out_normalize(df, pdf):

Callers

nothing calls this directly

Calls 4

assert_eqFunction · 0.90
sort_valuesMethod · 0.80
uniqueMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…