.groupby.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.last  #

SeriesGroupBy.  last  (  _ numeric_only  =  False  _ , _ min_count  =  -1  _ ,
_ skipna  =  True  _ )  [ [source]  ](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/groupby/groupby.py#L3417-L3484) #

    

Compute the last entry of each column within each group.

Defaults to skipping NA elements.

Parameters  :

    

**numeric_only** bool, default False

    

Include only float, int, boolean columns. If None, will attempt to use
everything, then use only numeric data.

**min_count** int, default -1

    

The required number of valid values to perform the operation. If fewer than `
min_count  ` valid values are present the result will be NA.

**skipna** bool, default True

    

Exclude NA/null values. If an entire row/column is NA, the result will be NA.

New in version 2.2.1.

Returns  :

    

Series or DataFrame

    

Last of values within each group.

See also

` DataFrame.groupby  `

    

Apply a function groupby to each row or column of a DataFrame.

[ ` pandas.core.groupby.DataFrameGroupBy.first  `
](pandas.core.groupby.DataFrameGroupBy.first.html#pandas.core.groupby.DataFrameGroupBy.first
"pandas.core.groupby.DataFrameGroupBy.first")

    

Compute the first non-null entry of each column.

[ ` pandas.core.groupby.DataFrameGroupBy.nth  `
](pandas.core.groupby.DataFrameGroupBy.nth.html#pandas.core.groupby.DataFrameGroupBy.nth
"pandas.core.groupby.DataFrameGroupBy.nth")

    

Take the nth row from each group.

Examples

    
    
    >>> df = pd.DataFrame(dict(A=[1, 1, 3], B=[5, None, 6], C=[1, 2, 3]))
    >>> df.groupby("A").last()
         B  C
    A
    1  5.0  2
    3  6.0  3
    

[ __ previous  pandas.core.groupby.SeriesGroupBy.head
](pandas.core.groupby.SeriesGroupBy.head.html "previous page") [ next
pandas.core.groupby.SeriesGroupBy.idxmax  __
](pandas.core.groupby.SeriesGroupBy.idxmax.html "next page")

__ On this page

  * ` SeriesGroupBy.last()  `

[ __ Show Source
](../../