Examples

In [1]:
import numpy as np
import pandas as pd
In [2]:
s = pd.Series(data=[2, None, 5, 2],
              index=['P', 'Q', 'R', 'S'])
s
Out[2]:
P    2.0
Q    NaN
R    5.0
S    2.0
dtype: float64

In [3]:
s.idxmin()
Out[3]:
'P'

If skipna is False and there is an NA value in the data, the function returns nan.

In [4]:
s.idxmin(skipna=False)
Out[4]:
nan