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')>>>s0    21    12    33    3Name: A, dtype: Int64

Example with order preservation: Slower, but keeps order

>>>s.unique()0    21    12    3Name: A, dtype: Int64

Example without order preservation: Faster, but loses original order

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

The unique values returned as a Series.

Return type:

bigframes.pandas.Series

On this page

This Page