max() simply returns the maximum value.

idmax() returns the index of the (first occurrence of the) maximum value, not the maximum value itself.

Answer from Alec on Stack Overflow
🌐
W3Schools
w3schools.com › python › pandas › ref_df_idxmax.asp
Pandas DataFrame idxmax() Method
W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.DataFrame.idxmax.html
pandas.DataFrame.idxmax — pandas 3.0.2 documentation
Return index of first occurrence of maximum over requested axis · NA/null values are excluded
Discussions

python - What´s the difference between idxmax() and max() inside a groupby pandas - Stack Overflow
I have a dataframe with data from many players of different teams. What I wanted was to groupby 'team' and only keep the rows with the max value from height. When I used this code, I just got the ... More on stackoverflow.com
🌐 stackoverflow.com
Pandas return row with the maximum value of a column
I’m trying to figure out how to return the row of a pandas dataframe with the maximum value in a certain column. I know that to find the maximum value in a column I use: df['columnName'].max() But I’m having a hard time figuring out how to return the whole row with the maximum value in ... More on community.dataquest.io
🌐 community.dataquest.io
5
0
January 30, 2020
How to find the highest number of times a string shows up in the dataset?
It's not that big a dataset, just load it into pandas, e.g.: In []: import pandas as pd df = pd.read_csv('kills.csv') df.groupby('Killer').count().Victim.idxmax() Out[]: 'SKT Bang' More on reddit.com
🌐 r/learnpython
10
3
December 9, 2019
python - Max Value in a Data Frame with Groupby using idmax() - Stack Overflow
I have a dataframe that has 10 columns. I used this code to filter to the rows I want: basically, the rows where the Revision Date is less than the cutoff date (declared variable) and the Job Title... More on stackoverflow.com
🌐 stackoverflow.com
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-pandas-dataframe-idxmax
Python | Pandas dataframe.idxmax() - GeeksforGeeks
November 19, 2018 - Pandas is one of those packages and makes importing and analyzing data much easier. Pandas dataframe.idxmax() function returns index of first occurrence of maximum over requested axis.
🌐
Medium
medium.com › @prathik.codes › idxmax-and-idxmin-in-pandas-399a4b1ceb99
idxmax() and idxmin() in Pandas. Python Quickies #15 | by Prathik C | Medium
January 19, 2025 - idxmax() and idxmin() in Pandas Python Quickies #15 I have been going through the Pandas tutorial in Kaggle. It is quite elementary but it has in fact taught me some new things that I did not learn …
🌐
Pandas
pandas.pydata.org › docs › reference › api › pandas.Series.idxmax.html
pandas.Series.idxmax — pandas 3.0.1 documentation
Return the row label of the maximum value · If multiple values equal the maximum, the first row label with that value is returned
Find elsewhere
🌐
Educative
educative.io › answers › what-is-pandas-idxmax-method-in-python
What is pandas idxmax() method in Python?
Among these tools is the idxmax() method, which serves the purpose of identifying the index (row label) corresponding to the maximum value along a specified axis in a Pandas DataFrame or ...
🌐
Delft Stack
delftstack.com › home › api › python pandas › pandas dataframe dataframe.idxmax function
Pandas DataFrame.idxmax() Function | Delft Stack
January 30, 2023 - The DataFrame idxmax() function returns the index of the maximum value in rows or columns.
🌐
Qiita
qiita.com › python
pandasのgroupbyを使ってグループ内で最大値(最小値)を持つ行を取得する #Python - Qiita
August 28, 2023 - はじめに データベースのカラムで、カテゴリ変数を値に持つカラムがあるとします。そのカテゴリごとの最大値もしくは最小値の列を求めたいことがあります。 pandasのidxmax()もしくはidxmin()で実現できます。 参考 pandasで最大値・最小値の行名・列名を...
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.argmax.html
numpy.argmax — NumPy v2.4 Manual
Returns the indices of the maximum values along an axis · By default, the index is into the flattened array, otherwise along the specified axis
🌐
Medium
medium.com › @TechTalkWithAlex › identify-missing-data-with-python-11cc67c42c32
Identify Missing Data with Python and how to handle it | by Tech Talk With Alex | Medium
November 17, 2022 - Thanks to the idmax() function, you can easily find out which is the most common value for a column. In the case of the “No.
🌐
Greg Kamradt
dataindependent.com › pandas › pandas-idxmax
Greg Kamradt
September 12, 2020 - President @ ARC Prize Foundation - A Northstar to AGI · I have been working on a series of products, investments, clients, and operating with application layer AI companies through Leverage
🌐
Kite
kite.com › python › answers › how-to-get-the-maximum-values-of-each-group-in-a-pandas-dataframe-in-python
Code Faster with Line-of-Code Completions, Cloudless Processing
Kite is a free autocomplete for Python developers. Code faster with the Kite plugin for your code editor, featuring Line-of-Code Completions and cloudless processing.
🌐
Codegrepper
codegrepper.com › code-examples › python › .idxmax()+python
idxmax in python - Code Examples & Solutions
>>> df.idxmax(axis="columns") Pork co2_emissions Wheat Products consumption Beef co2_emissions dtype: object
🌐
Pretagteam
pretagteam.com › question › pandas-idxmax-return-all-rows-in-case-of-ties
Pretagteam
October 27, 2021 - Questions - Find the Best Solution For Your questions