0

Could you please check this code?

I am solving the Code project: COVID Data Analysis on Python for Data Science. INSTRUCTIONS 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("https://www.sololearn.com/uploads/ca-covid.csv") df.drop('state', axis=1, inplace=True) df.set_index('date', inplace=True) df['ratio'] = df['deaths']/df['cases'] max_ratio = df['ratio'].max() print(df[df['ratio']==max_ratio]) I tried in VisualStudio Code and it is perfect but I am not able to pass the code project. Any help would be appreciated!!

21st Dec 2021, 4:28 AM
Dajeury Velez Lima
Dajeury Velez Lima - avatar
2 Réponses
+ 1
I don't know what database. management do you use or programming language that is, but in mysql, you can't input that CSV, Look at column 276, there's empty cell, and in column 344, 2nd cell to 4th cell is empty. means you hit enter that cause first column to go down one more.
21st Dec 2021, 5:44 AM
Jonathan P. Jundarino
Jonathan P. Jundarino - avatar
0
I appreciate your answer, I tested that line of code and It worked perfectly. Some rows might be empty because there is no cases or deaths on those days.
22nd Dec 2021, 2:57 AM
Dajeury Velez Lima
Dajeury Velez Lima - avatar