Can not pass internal test and don't see result of programme. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can not pass internal test and don't see result of programme.

Hello everyone, help me please. I can not pass internal test and I don't see result of programme. Text of task: You are working with the COVID dataset for California, which includes the number of cases and deaths for each day of 2020. Find the day when the deaths/cases ratio was largest. To do this, you need to first calculate the deaths/cases ratio and add it as a column to the DataFrame with the name 'ratio', then find the row that corresponds to the largest value. My code: import pandas as pd df = pd.read_csv("/usercode/files/ca-covid.csv") df.drop('state', axis=1, inplace=True) df.set_index('date', inplace=True) ratio = df['death']/df['cases'] df['ratio'] = ratio max_ratio = df['ratio'].max() print(df[df['ratio'] == max_ratio])

19th Jan 2022, 6:20 AM
Lyapunov Alexander
Lyapunov Alexander - avatar
2 Answers
+ 5
'deaths'
19th Jan 2022, 8:03 AM
Simba
Simba - avatar
+ 1
Simba Thank you very much! Just I could not see result and did not find this is simple mistake.
19th Jan 2022, 4:57 PM
Lyapunov Alexander
Lyapunov Alexander - avatar