Series.idxmin(self, axis=0, skipna=True, *args, **kwargs)
[source]
Return the row label of the minimum value.
If multiple values equal the minimum, the first row label with that value is returned.
Parameters: |
|
---|---|
Returns: |
|
Raises: |
|
See also
numpy.argmin
DataFrame.idxmin
Series.idxmax
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()
.
>>> s = pd.Series(data=[1, None, 4, 1], ... index=['A', 'B', 'C', 'D']) >>> s A 1.0 B NaN C 4.0 D 1.0 dtype: float64
>>> s.idxmin() 'A'
If skipna
is False and there is an NA value in the data, the function returns nan
.
>>> s.idxmin(skipna=False) nan
© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.Series.idxmin.html