This is a package for COVID-19 data analysis with SIR-derived models. Please refer to COVID-19 data with SIR model notebook in Kaggle to understand the methods of analysis.
With this Python package we can apply SIR-F model to COVID-19 data. SIR-F is a customized ODE model derived from SIR model. To evaluate the effect of measures, parameter estimation of SIR-F will be applied to subsets of time series data in each country. Parameter change points will be determined by S-R trend analysis. The details are explained in COVID-19 data with SIR model in Kaggle.
The datasets can be download using Kaggle API key and Kaggle package. Please read How to Use Kaggle: Public API and my Bash code
input.sh in this repository.
Primary source: COVID-19 Data Repository by CSSE at Johns Hopkins University
Secondary source: Novel Corona Virus 2019 Dataset by SRK
Primary source: Ministry of Health, Labour and Welefare HP (in English)
Secondary source: Secondary source: COVID-19 dataset in Japan by Lisphilar
When you use this package in Kaggle notebook (need to turn on Internet option in notebook settings) or local environment with Pip,
pip install git+https://github.com/lisphilar/covid19-sir#egg=covsirphy
With Pipenv environment,
pipenv install git+https://github.com/lisphilar/covid19-sir#egg=covsirphy
git clone https://github.com/lisphilar/covid19-sir.git pipenv install --dev
Import this package.
import covsirphy as cs from covsirphy import JHUData, Population
Perform data cleaning of JHU dataset.
# With CSV filepath of JHU dataset jhu_data = JHUData("input/covid_19_data.csv") jhu_data.cleaned()
We can import dataset for one country.
# As an example, read Japan dataset jpn_data = CountryData("input/covid_jpn_total.csv", country="Japan") jpn_data.set_variables( date="Date", confirmed="Positive", fatal="Fatal", recovered="Discharged", province=None ) jpn_data.cleaned()
Perform data cleaning of population dataset.
# With CSV filepath of population dataset pop = Population("input/locations_population.csv") pop_dict = pop.to_dict(country_level=True)
(Please see the Kaggle notebook, update later)
Lisphilar, 2020, Kaggle notebook, COVID-19 data with SIR model, https://www.kaggle.com/lisphilar/covid-19-data-with-sir-model
Lisphilar, 2020, GitHub repository, Covsirphy, Python package for COVID-19 data with SIR model, https://github.com/lisphilar/covid19-sir