modin.pandas.DataFrameGroupBy.idxmax¶
- DataFrameGroupBy.idxmax(axis: Union[int, Literal['index', 'columns', 'rows']] = _NoDefault.no_default, skipna: bool = True, numeric_only: bool = False)[source]¶
Return the index of the first occurrence of maximum over requested axis.
NA/null values are excluded based on skipna.
- 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.
Snowpark pandas does not support axis=1, since it is deprecated in pandas.
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.
- Returns:
Indexes of maxima along the specified axis.
- Return type:
- Raises:
ValueError – If the row/column is empty
See also
Series.idxmaxReturn index of the maximum element.
Notes
This method is the
DataFrameversion ofndarray.argmax.Examples
Group by axis=0, apply idxmax on axis=0