pandas 1.4.2

NotesParametersRaisesReturnsBackRef
idxmin(self, axis=0, skipna=True, *args, **kwargs)

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

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() .

Parameters

axis : int, default 0

For compatibility with DataFrame.idxmin. Redundant for application on Series.

skipna : bool, default True

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

*args, **kwargs :

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

Raises

ValueError

If the Series is empty.

Returns

Index

Label of the minimum value.

Return the row label of the minimum value.

See Also

DataFrame.idxmin

Return index of first occurrence of minimum over requested axis.

Series.idxmax

Return index label of the first occurrence of maximum of values.

numpy.argmin

Return indices of the minimum values along the given axis.

Examples

This example is valid syntax, but we were not able to check execution
>>> 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
This example is valid syntax, but we were not able to check execution
>>> s.idxmin()
'A'

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

This example is valid syntax, but we were not able to check execution
>>> s.idxmin(skipna=False)
nan
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

pandas.core.base.IndexOpsMixin.argmin pandas.core.generic.NDFrame._add_numeric_operations.<locals>.prod pandas.core.series.Series.idxmax pandas.core.generic.NDFrame._add_numeric_operations.<locals>.sum pandas.core.base.IndexOpsMixin.argmax pandas.core.generic.NDFrame._add_numeric_operations.<locals>.min pandas.core.groupby.generic.DataFrameGroupBy.idxmin pandas.core.indexes.base.Index.argmax pandas.core.frame.DataFrame.idxmin pandas.core.generic.NDFrame._add_numeric_operations.<locals>.max pandas.core.indexes.base.Index.argmin

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /pandas/core/series.py#2270
type: <class 'function'>
Commit: