+ 6
According to the latest Pandas documentation there is a parameter for this function to exclude non-numeric columns.
Check which version of pandas you have installed, to make sure it's available.
You could also try excluding the non-numeric column by applying the function to only a slice of the dataframe.
df[['A', 'B']]
https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.idxmax.html
numeric_only bool, default False
Include only float, int or boolean data.
New in version 1.5.0.
In any case, to diagnose "where you messed up in generating your dataframe", one would have to see your actual code. There are no miraculous psychics here who can read your mind.
0
Hello dear Rob. Would you mind checking your messages?