+ 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.
4th Apr 2023, 4:34 AM
Tibor Santa
Tibor Santa - avatar
0
Hello dear Rob. Would you mind checking your messages?
19th Sep 2023, 5:41 AM
Azade Asghari
Azade Asghari - avatar