bigframes.pandas.Series.unique#

Series.unique(keep_order=True) Series[source]#

Return unique values of Series object.

By default, uniques are returned in order of appearance. Hash table-based unique, therefore does NOT sort.

Parameters:

keep_order (bool, default True) – If True, preserves the order of the first appearance of each unique value. If False, returns the elements in ascending order, which can be faster.

Examples:

>>> s = bpd.Series([2, 1, 3, 3], name='A')
>>> s
0    2
1    1
2    3
3    3
Name: A, dtype: Int64

Example with order preservation: Slower, but keeps order

>>> s.unique()
0    2
1    1
2    3
Name: A, dtype: Int64

Example without order preservation: Faster, but loses original order

>>> s.unique(keep_order=False)
0    1
1    2
2    3
Name: A, dtype: Int64
Returns:

The unique values returned as a Series.

Return type:

bigframes.pandas.Series