Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K

pandas.Series.idxmin#

Series.idxmin(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 thatvalue is returned.

Parameters:
axis{0 or ‘index’}

Unused. Parameter needed for compatibility with DataFrame.

skipnabool, default True

Exclude NA/null values. If the entire Series is NA, the resultwill be NA.

*args, **kwargs

Additional arguments and keywords have no effect but might beaccepted for compatibility with NumPy.

Returns:
Index

Label of the minimum value.

Raises:
ValueError

If the Series is empty.

See also

numpy.argmin

Return indices of the minimum values along the given axis.

DataFrame.idxmin

Return index of first occurrence of minimum over requested axis.

Series.idxmax

Return indexlabel of the first occurrence of maximum of values.

Notes

This method is the Series version ofndarray.argmin. This methodreturns the label of the minimum, whilendarray.argmin returnsthe position. To get the position, useseries.values.argmin().

Examples

>>>s=pd.Series(data=[1,None,4,1],...index=['A','B','C','D'])>>>sA    1.0B    NaNC    4.0D    1.0dtype: float64
>>>s.idxmin()'A'

Ifskipna is False and there is an NA value in the data,the function returnsnan.

>>>s.idxmin(skipna=False)nan

[8]ページ先頭

©2009-2025 Movatter.jp