pyspark.pandas.Series.argmax¶
-
Series.
argmax
(axis: Union[int, str] = None, skipna: bool = True) → int¶ Return int position of the largest value in the Series.
If the maximum is achieved in multiple locations, the first row position is returned.
- Parameters
- axis{{None}}
Dummy argument for consistency with Series.
- skipnabool, default True
Exclude NA/null values. If the entire Series is NA, the result will be NA.
- Returns
- int
Row position of the maximum value.
Examples
Consider dataset containing cereal calories
>>> s = ps.Series({'Corn Flakes': 100.0, 'Almond Delight': 110.0, 'Unknown': np.nan, ... 'Cinnamon Toast Crunch': 120.0, 'Cocoa Puff': 110.0}) >>> s Corn Flakes 100.0 Almond Delight 110.0 Unknown NaN Cinnamon Toast Crunch 120.0 Cocoa Puff 110.0 dtype: float64
>>> s.argmax() 3
>>> s.argmax(skipna=False) -1