+ 1

plz help me to solve the covid data analysis project in python for data science

16th Apr 2021, 6:40 AM
HEWAGAMAGE LAKSHITHA SHESHAN
HEWAGAMAGE LAKSHITHA SHESHAN - avatar
7 Respostas
+ 4
ok u add ratio. Now u need filter dates with max ratio for this u can use simple equal df["ratio"]==df["ratio"].max() put this equal in df[here] and u got dates with max ratio https://code.sololearn.com/co287aYKt37I/?ref=app
16th Apr 2021, 7:31 AM
Илья Мирошник
Илья Мирошник - avatar
+ 2
I know what this task is. I want to know what your problem is. you want to get a solution or you want to get knowledge of how to solve.
16th Apr 2021, 7:19 AM
Илья Мирошник
Илья Мирошник - avatar
0
Hmm, where your try or problem question?
16th Apr 2021, 6:55 AM
Илья Мирошник
Илья Мирошник - avatar
0
In sololearn python for data science course data manipulation with pandas chapter project
16th Apr 2021, 7:12 AM
HEWAGAMAGE LAKSHITHA SHESHAN
HEWAGAMAGE LAKSHITHA SHESHAN - avatar
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'] maxindx=df['ratio'].idxmax() print(df.iloc[maxindx]) i tried like this.. its not getting perfect
16th Apr 2021, 7:27 AM
HEWAGAMAGE LAKSHITHA SHESHAN
HEWAGAMAGE LAKSHITHA SHESHAN - avatar
0
I got it.. thnk u so much 😊
16th Apr 2021, 7:38 AM
HEWAGAMAGE LAKSHITHA SHESHAN
HEWAGAMAGE LAKSHITHA SHESHAN - avatar
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"] max_ratio = df.loc[df["ratio"]==df["ratio"].max()] print(max_ratio)
18th May 2022, 9:39 AM
Derbew Asefa Alemu
Derbew Asefa Alemu - avatar