upby.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.nlargest  #

SeriesGroupBy.  nlargest  (  _ n  =  5  _ , _ keep  =  'first'  _ )  [
[source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/groupby/generic.py#L1154-L1163) #

    

Return the largest  n  elements.

Parameters  :

    

**n** int, default 5

    

Return this many descending sorted values.

**keep** {âfirstâ, âlastâ, âallâ}, default âfirstâ

    

When there are duplicate values that cannot all fit in a Series of  n
elements:

  * ` first  ` : return the first  n  occurrences in order of appearance. 

  * ` last  ` : return the last  n  occurrences in reverse order of appearance. 

  * ` all  ` : keep all occurrences. This can result in a Series of size larger than  n  . 

Returns  :

    

Series

    

The  n  largest values in the Series, sorted in decreasing order.

See also

` Series.nsmallest  `

    

Get the  n  smallest elements.

` Series.sort_values  `

    

Sort Series by values.

` Series.head  `

    

Return the first  n  rows.

Notes

Faster than ` .sort_values(ascending=False).head(n)  ` for small  n  relative
to the size of the ` Series  ` object.

Examples

    
    
    >>> countries_population = {"Italy": 59000000, "France": 65000000,
    ...                         "Malta": 434000, "Maldives": 434000,
    ...                         "Brunei": 434000, "Iceland": 337000,
    ...                         "Nauru": 11300, "Tuvalu": 11300,
    ...                         "Anguilla": 11300, "Montserrat": 5200}
    >>> s = pd.Series(countries_population)
    >>> s
    Italy       59000000
    France      65000000
    Malta         434000
    Maldives      434000
    Brunei        434000
    Iceland       337000
    Nauru          11300
    Tuvalu         11300
    Anguilla       11300
    Montserrat      5200
    dtype: int64
    

The  n  largest elements where ` n=5  ` by default.

    
    
    >>> s.nlargest()
    France      65000000
    Italy       5900