roupby.SeriesGroupBy.rolling ](pandas.core.groupby.SeriesGroupBy.rolling.html)
    * [ pandas.core.groupby.SeriesGroupBy.sample ](pandas.core.groupby.SeriesGroupBy.sample.html)
    * [ pandas.core.groupby.SeriesGroupBy.sem ](pandas.core.groupby.SeriesGroupBy.sem.html)
    * [ pandas.core.groupby.SeriesGroupBy.shift ](pandas.core.groupby.SeriesGroupBy.shift.html)
    * [ pandas.core.groupby.SeriesGroupBy.size ](pandas.core.groupby.SeriesGroupBy.size.html)
    * [ pandas.core.groupby.SeriesGroupBy.skew ](pandas.core.groupby.SeriesGroupBy.skew.html)
    * [ pandas.core.groupby.SeriesGroupBy.std ](pandas.core.groupby.SeriesGroupBy.std.html)
    * [ pandas.core.groupby.SeriesGroupBy.sum ](pandas.core.groupby.SeriesGroupBy.sum.html)
    * [ pandas.core.groupby.SeriesGroupBy.var ](pandas.core.groupby.SeriesGroupBy.var.html)
    * [ pandas.core.groupby.SeriesGroupBy.tail ](pandas.core.groupby.SeriesGroupBy.tail.html)
    * [ pandas.core.groupby.SeriesGroupBy.take ](pandas.core.groupby.SeriesGroupBy.take.html)
    * [ pandas.core.groupby.SeriesGroupBy.value_counts ](pandas.core.groupby.SeriesGroupBy.value_counts.html)
    * [ pandas.core.groupby.DataFrameGroupBy.boxplot ](pandas.core.groupby.DataFrameGroupBy.boxplot.html)
    * [ pandas.core.groupby.DataFrameGroupBy.hist ](pandas.core.groupby.DataFrameGroupBy.hist.html)
    * [ pandas.core.groupby.SeriesGroupBy.hist ](pandas.core.groupby.SeriesGroupBy.hist.html)
    * [ pandas.core.groupby.DataFrameGroupBy.plot ](pandas.core.groupby.DataFrameGroupBy.plot.html)
    * [ pandas.core.groupby.SeriesGroupBy.plot ](pandas.core.groupby.SeriesGroupBy.plot.html)
  * [ Resampling ](../resampling.html)
  * [ Style ](../style.html)
  * [ Plotting ](../plotting.html)
  * [ Options and settings ](../options.html)
  * [ Extensions ](../extensions.html)
  * [ Testing ](../testing.html)
  * [ Missing values ](../missing_value.html)

  * [ __ ](../../index.html)
  * [ API reference ](../index.html)
  * [ GroupBy ](../groupby.html)
  * pandas.core.... 

#  pandas.core.groupby.SeriesGroupBy.unique  #

SeriesGroupBy.  unique  (  )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/groupby/generic.py#L1285-L1326) #

    

Return unique values for each group.

It returns unique values for each of the grouped values. Returned in order of
appearance. Hash table-based unique, therefore does NOT sort.

Returns  :

    

Series

    

Unique values for each of the grouped values.

See also

` Series.unique  `

    

Return unique values of Series object.

Examples

    
    
    >>> df = pd.DataFrame([('Chihuahua', 'dog', 6.1),
    ...                    ('Beagle', 'dog', 15.2),
    ...                    ('Chihuahua', 'dog', 6.9),
    ...                    ('Persian', 'cat', 9.2),
    ...                    ('Chihuahua', 'dog', 7),
    ...                    ('Persian', 'cat', 8.8)],
    ...                   columns=['breed', 'animal', 'height_in'])
    >>> df
           breed     animal   height_in
    0  Chihuahua        dog         6.1
    1     Beagle        dog        15.2
    2  Chihuahua        dog         6.9
    3    Persian        cat         9.2
    4  Chihuahua        dog         7.0
    5    Persian        cat         8.8
    >>> ser = df.groupby('animal')['breed'].unique()
    >>> ser
    animal
    cat              [Persian]
    dog    [Chihuahua, Beagle]
    Name: breed, dtype: object
    

[ __ previous  pandas.core.groupby.SeriesGroupBy.nunique
](pandas.core.groupby.SeriesGroupBy.nunique.html "previous page") [ next
pandas.core.groupby.SeriesGroupBy.ohlc  __
](pandas.core.groupby.SeriesGroupBy.ohlc.html "next page")

__ On this page

  * ` SeriesGroupBy.unique()  `

[ __ Show Source
](../../_sources/reference/api/pandas.core.groupby.SeriesGroupBy.unique.rst.txt)

© 2024, pandas via [ NumFOCUS, Inc. ](https://numfocus.org) Hosted by [
OVHcloud ](https://www.ovhcloud.com) .

Created using [ Sphinx ](https://www.sphinx-doc.org/) 7.2.6.  

Built with the [ PyData Sphinx T