idxmax(self, axis=0, skipna=True, *args, **kwargs)
If multiple values equal the maximum, the first row label with that value is returned.
This method is the Series version of ndarray.argmax
. This method returns the label of the maximum, while ndarray.argmax
returns the position. To get the position, use series.values.argmax()
.
For compatibility with DataFrame.idxmax. Redundant for application on Series.
Exclude NA/null values. If the entire Series is NA, the result will be NA.
Additional arguments and keywords have no effect but might be accepted for compatibility with NumPy.
If the Series is empty.
Label of the maximum value.
Return the row label of the maximum value.
DataFrame.idxmax
Return index of first occurrence of maximum over requested axis.
Series.idxmin
Return index label of the first occurrence of minimum of values.
numpy.argmax
Return indices of the maximum values along the given axis.
>>> s = pd.Series(data=[1, None, 4, 3, 4],This example is valid syntax, but we were not able to check execution
... index=['A', 'B', 'C', 'D', 'E'])
... s A 1.0 B NaN C 4.0 D 3.0 E 4.0 dtype: float64
>>> s.idxmax() 'C'
If :None:None:`skipna`
is False and there is an NA value in the data, the function returns nan
.
>>> s.idxmax(skipna=False) nanSee :
The following pages refer to to this document either explicitly or contain code examples using this.
pandas.core.series.Series.idxmin
pandas.core.frame.DataFrame.idxmax
pandas.core.base.IndexOpsMixin.argmin
pandas.core.generic.NDFrame._add_numeric_operations.<locals>.prod
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.indexes.base.Index.argmax
pandas.core.groupby.generic.DataFrameGroupBy.idxmax
pandas.core.generic.NDFrame._add_numeric_operations.<locals>.max
pandas.core.indexes.base.Index.argmin
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