+ 1

Python Pandas challenge

Here's the code, below https://code.sololearn.com/cS1ebdVf3xuy/#py. I can't understand why the second print option doesn't work. Can anyone explain. Thank you

18th Aug 2022, 12:42 PM
Key- tune S
Key- tune S - avatar
2 Respostas
+ 1
df['ratio'].max() returns the max value, not the index of the max value. In the 1st code example, you get the max value and then search in which row this max value is. Then you access this row in the dataframe.
18th Aug 2022, 12:45 PM
Lisa
Lisa - avatar
0
Thank you, Lisa. I tried various solutions, to practice on mistakes. I always have in mind that there is more simple solution :D
18th Aug 2022, 12:47 PM
Key- tune S
Key- tune S - avatar