Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
SM-ins opened this issue Jul 18, 2020 · 8 comments
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@SM-ins
Copy link

SM-ins commented Jul 18, 2020

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

@SM-ins SM-ins added the bug Something isn't working label Jul 18, 2020
@lisphilar
Copy link
Owner

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
Copy link
Owner

lisphilar commented Jul 18, 2020

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"
)

@lisphilar lisphilar added documentation Improvements or additions to documentation question Further information is requested labels Jul 18, 2020
@lisphilar lisphilar changed the title Error How to replace JHU data with country-wise data (India) Jul 18, 2020
@lisphilar lisphilar removed the bug Something isn't working label Jul 18, 2020
@SM-ins
Copy link
Author

SM-ins commented Jul 19, 2020 via email

@lisphilar
Copy link
Owner

Thank you!
I will close this issue.

@SM-ins
Copy link
Author

SM-ins commented Jul 29, 2020

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
Copy link
Owner

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

@lisphilar lisphilar reopened this Jul 29, 2020
@SM-ins
Copy link
Author

SM-ins commented Jul 30, 2020

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

@lisphilar lisphilar changed the title How to replace JHU data with country-wise data (India) How to replace JHU data with country-wise data (India) and error in cleaning country level datasets Jul 30, 2020
@lisphilar
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants