- 2
Who can help with this?
You are working with the 'ca-covid' CSV file that contains the COVID-19 infection data in California for the year 2020. The file provides data on daily cases and deaths for the entire year. Find and output the row that corresponds to December 31, 2020.
6 Respuestas
+ 4
We are not here to do your homework for you.
If you need help, please show us your code so we can help you
0
import pandas as pd
df = pd.read_csv("/usercode/files/ca-covid.csv")
df.set_index('date', inplace=True)
print(df[['cases' , 'deaths']].iloc[-1:])
what you think about this
0
import pandas as pd
df = pd.read_csv("/usercode/files/ca-covid.csv")
df.set_index('date', inplace=True)
df.drop('state', axis=1, inplace=True)
print(df.loc['31.12.20'])
i hope that it help you
0
import pandas as pd
df = pd.read_csv("/usercode/files/ca-covid.csv")
df.set_index('date', inplace=True)
df.drop('state', axis=1, inplace=True)
print(df.iloc[-1])
0
print(df.iloc[-1])