0

Pandas input

I have task in Pandas FrameWork. I have to operate with columns of FW. How can I do that if I see no column titles and what is what?.. the task about Covid where I have to determine the day with highest infected/dead ratio

16th Sep 2022, 9:14 PM
Aleksandr Malyuk
Aleksandr Malyuk - avatar
1 Réponse
0
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) df['ratio'] = df['deaths'] / df['cases'] y=df["ratio"].idxmax() x=df.loc[[y]] print(x)
21st Sep 2022, 10:28 PM
Felipe Osorio
Felipe Osorio - avatar