- Published on
- · Data Independent
Pandas Index Max | pd.DataFrame.idxmax()
This post is auto-generated from a public YouTube video for personal study notes. It is not an endorsement. The transcript is machine-derived and may contain errors; refer to the original video for accuracy.
About this video
Pandas idxmax is a very convenient function that will return the index of the maximum value across a specified axis.
It is especially useful when trying to figure out the max column values for your rows OR maximum row value for your columns.
Say you have a list of students as your rows, and test scores in your columns. Which test was the highest for each student? .idxmax() is a one-liner that'll tell you.
pd.DataFrame.idxmax(axis='your_axis_for_max')
Loading transcript…