COVID Data Analysis
Help me, I already found the answer but i don't know how to match it with the answer key Question : Phyton for Data Science COVID Data Analysis 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. And here is 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) max = 0 maxindex = 0 ratio= [] for i in df.index: a= df["deaths"][i] / df["cases"][i] ratio.append(a) if (a > max): max = a maxindex = i df['ratio']=ratio #print(df) #print(maxindex) print(df.iloc[maxindex])