lisphilar / covid19-sir

CovsirPhy: Python library for COVID-19 analysis with phase-dependent SIR-derived ODE models.
https://lisphilar.github.io/covid19-sir/
Apache License 2.0
109 stars 44 forks source link

How to replace JHU data with country-wise data (India) and error in cleaning country level datasets #120

Closed SM-ins closed 4 years ago

SM-ins commented 4 years ago

Dear @lisphilar ,

while running the following code,i am getting mentioned error:-

ind_data = cs.CountryData("/kaggle/input/covid19-in-india/covid_19_india.csv",Country="India") ind_data.set_variables( date="Date", confirmed="Positive", fatal="Fatal", recovered="Discharged", province=None ) ind_data.cleaned().tail()

TypeError: init() got an unexpected keyword argument 'Country'

I just replace the country by India in place of japan and change the file path too...,but in spite of that I am getting above error..,will you please help..

With regards, Rakesh

lisphilar commented 4 years ago

Dear Rakesh, Please use small characters as the arguments of methods like this.

ind_data = cs.CountryData("/kaggle/input/covid19-in-india/covid_19_india.csv",country="India")

Before: Country="India" After: country="India"

Thank you.

lisphilar commented 4 years ago

Dear Rakesh, Please read documentation of CountryData.set_variables() https://lisphilar.github.io/covid19-sir/covsirphy.cleaning.html#covsirphy.cleaning.country_data.CountryData.set_variables

(If you find errors or something to know, please let me know as always.)

Did you use the following dataset? https://www.kaggle.com/sudalairajkumar/covid19-in-india?select=covid_19_india.csv

I think the following codes will be necessary.

ind_data.set_variables(
date="Date", confirmed="Confirmed", fatal="Deaths", recovered="Cured", province="State/UnionTerritory"
)
SM-ins commented 4 years ago

Dear @lisphilar/covid19-sir reply@reply.github.com ,

Yes..,you are right..,the given code is necessary as column name were not matching..,thanks for the help..

With regards, Rakesh

On Sat, Jul 18, 2020 at 10:18 PM Lisphilar notifications@github.com wrote:

Dear Rakesh, Please read documentation of CountryData.set_variables()

https://lisphilar.github.io/covid19-sir/covsirphy.cleaning.html#covsirphy.cleaning.country_data.CountryData.set_variables

(If you find errors or something to know, please let me know as always.)

Did you used the following dataset?

https://www.kaggle.com/sudalairajkumar/covid19-in-india?select=covid_19_india.csv

I think the following codes will be necessary.

ind_data.set_variables(date="Date", confirmed="Confirmed", fatal="Deaths", recovered="Cured", province="State/UnionTerritory" )

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lisphilar/covid19-sir/issues/120#issuecomment-660509535, or unsubscribe https://github.com/notifications/unsubscribe-auth/AP6Y4PGNNOM25Y77WKYFPJDR4HG6BANCNFSM4O77E7SA .

lisphilar commented 4 years ago

Thank you! I will close this issue.

SM-ins commented 4 years ago

Dear Lisphilar,

i am agin encountering error in in running the above code:- ind_data = cs.CountryData("/kaggle/input/covid19-in-india/covid_19_india.csv",country="India") ind_data.set_variables( date="Date", confirmed="Confirmed", fatal="Deaths", recovered="Cured", province="State/UnionTerritory" ) ind_data.cleaned().tail()

ValueError: Cannot convert non-finite values (NA or inf) to integer Please look into it....

With regards, Rakesh

lisphilar commented 4 years ago

Dear Rakesh, It seems that NA values were added to the raw dataset. I will add .fillna(0) in cleaning method ofcs.CountryData class.

SM-ins commented 4 years ago

Dear Lisphilar, Thanks for the response...,okey..kindly let me know after adding it..

lisphilar commented 4 years ago

Dear Rakesh, I fixed this in version 2.6.0-alpha.fix.120 Please confirm it.