pyspark.pandas.Series.argmin

Series.argmin(axis: Union[int, str] = None, skipna: bool = True) → int[source]

Return int position of the smallest value in the Series.

If the minimum is achieved in multiple locations, the first row position is returned.

Parameters
axisNone

Dummy argument for consistency with Series.

skipnabool, default True

Exclude NA/null values.

Returns
int

Row position of the minimum value.

Examples

Consider dataset containing cereal calories

>>> s = ps.Series({'Corn Flakes': 100.0, 'Almond Delight': 110.0,
...                'Cinnamon Toast Crunch': 120.0, 'Cocoa Puff': 110.0})
>>> s  
Corn Flakes              100.0
Almond Delight           110.0
Cinnamon Toast Crunch    120.0
Cocoa Puff               110.0
dtype: float64
>>> s.argmin()  
0