Pandas Series: idxmin() function

Row label of the minimum value in Pandas series

The idxmin() function is used to get the row label of the minimum value.

If multiple values equal the minimum, the first row label with that value is returned.


Series.idxmin(self, axis=0, skipna=True, *args, **kwargs)
Pandas Series idxmin image


Name Description Type/Default Value Required / Optional
skipna Exclude NA/null values. If the entire Series is NA, the result will be NA. bool
Default Value: True
axis For compatibility with DataFrame.idxmin. Redundant for application on Series. bool
Default Value: 0
*args, **kwargs Additional keywords have no effect but might be accepted for compatibility with NumPy. Required

Returns: Index
Label of the minimum value.

Raises: ValueError
If the Series is empty.

Notes: This method is the Series version of ndarray.argmin. This method returns the label of the minimum, while ndarray.argmin returns the position. To get the position, use series.values.argmin().


Download the above Notebook from here.

Previous: Get the row label of the maximum value in Pandas series
Next: Find values contained in Pandas series

Share this Tutorial / Exercise on : Facebook and Twitter