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

Method unique

dask/dataframe/dask_expr/_collection.py:4345–4363  ·  view source on GitHub ↗

Return Series of unique values in the object. Includes NA values. Returns ------- uniques : Series Notes ----- Unlike :meth:`pandas.Series.unique`, the order of the returned values is not guaranteed to match the order of first appear

(self, split_every=None, split_out=True, shuffle_method=None)

Source from the content-addressed store, hash-verified

4343 return new_collection(MemoryUsageFrame(self, deep=deep, _index=index))
4344
4345 def unique(self, split_every=None, split_out=True, shuffle_method=None):
4346 """
4347 Return Series of unique values in the object. Includes NA values.
4348
4349 Returns
4350 -------
4351 uniques : Series
4352
4353 Notes
4354 -----
4355 Unlike :meth:`pandas.Series.unique`, the order of the returned
4356 values is not guaranteed to match the order of first appearance
4357 in the data, because ``unique`` shuffles the data under the hood
4358 to avoid overloading a single worker. To preserve the original
4359 order, pass ``split_out=1`` to use a tree reduction instead
4360 (only suitable for low-cardinality data).
4361 """
4362 shuffle_method = _get_shuffle_preferring_order(shuffle_method)
4363 return new_collection(Unique(self, split_every, split_out, shuffle_method))
4364
4365 @derived_from(pd.Series)
4366 def nunique(self, dropna=True, split_every=False, split_out=True):

Callers 15

test_hash_split_uniqueFunction · 0.95
from_collectionsMethod · 0.45
unpack_collectionsFunction · 0.45
ensure_dictFunction · 0.45
_nunique_df_chunkFunction · 0.45
_nunique_df_combineFunction · 0.45
_unique_aggregateFunction · 0.45
uniqueFunction · 0.45
_lowerMethod · 0.45
_calculate_divisionsFunction · 0.45
as_knownMethod · 0.45

Calls 3

new_collectionFunction · 0.90
UniqueClass · 0.90

Tested by 15

test_hash_split_uniqueFunction · 0.76
test_uniqueFunction · 0.36
test_uniqueFunction · 0.36
test_unique_baseFunction · 0.36
test_partition_onFunction · 0.36
test_partition_on_stringFunction · 0.36