Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!
In [5]:
import pandas as pd
In [3]:
s = pd.Series(
data=[1, None, 4, 3, 4],
index=['A', 'B', 'C', 'D', 'E']
)
s
Out[3]:
pandas.DataFrame.idxmax¶
Return index of first occurrence of maximum over requested axis. NA/null values are excluded.
In [4]:
s.idxmax()
Out[4]:
pandas.Series.argmax¶
Return int position of the largest value in the Series. If the maximum is achieved in multiple locations, the first row position is returned.
In [5]:
s.argmax()
Out[5]: