pby.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.DataFrameGroupBy.idxmax  #

DataFrameGroupBy.  idxmax  (  _ axis  =  _NoDefault.no_default  _ , _ skipna
=  True  _ , _ numeric_only  =  False  _ )  [ [source]
](https://github.com/pandas-
dev/pandas/blob/v2.2.2/pandas/core/groupby/generic.py#L2099-L2179) #

    

Return index of first occurrence of maximum over requested axis.

NA/null values are excluded.

Parameters  :

    

**axis** {{0 or âindexâ, 1 or âcolumnsâ}}, default None

    

The axis to use. 0 or âindexâ for row-wise, 1 or âcolumnsâ for column-
wise. If axis is not provided, grouperâs axis is used.

Changed in version 2.0.0.

Deprecated since version 2.1.0:  For axis=1, operate on the underlying object
instead. Otherwise the axis keyword is not necessary.

**skipna** bool, default True

    

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

**numeric_only** bool, default False

    

Include only  float  ,  int  or  boolean  data.

New in version 1.5.0.

Returns  :

    

Series

    

Indexes of maxima along the specified axis.

Raises  :

    

ValueError

    

  * If the row/column is empty 

See also

` Series.idxmax  `

    

Return index of the maximum element.

Notes

This method is the DataFrame version of ` ndarray.argmax  ` .

Examples

Consider a dataset containing food consumption in Argentina.

    
    
    >>> df = pd.DataFrame({'consumption': [10.51, 103.11, 55.48],
    ...                    'co2_emissions': [37.2, 19.66, 1712]},
    ...                   index=['Pork', 'Wheat Products', 'Beef'])
    
    
    
    >>> df
                    consumption  co2_emissions
    Pork                  10.51         37.20
    Wheat Products       103.11         19.66
    Beef                  55.48       1712.00
    

By default, it returns the index for the maximum value in each column.

    
    
    >>> df.idxmax()
    consumption     Wheat Products
    co2_emissions             Beef
    dtype: object
    

To r