<jupyter_start><jupyter_text>Oxford University COVID-19 forecasting project dataThe data below was downloaded from the [Oxford University countermeasures database](https://www.notion.so/COVID-19-countermeasures-database-b532a58d6f944ef6982ab565627bdb08). See the website for a description of the data sources.<jupyter_code>countermeasures_df = pd.read_csv("data/containment_measures_march23.csv")
countermeasures_df.head(1)
countermeasures_df[["Country", "Date Start", "Description of measure implemented"]].groupby("Country").head(10)
print(countermeasures_df["Country"].unique())
print(countermeasures_df["Implementing City"].unique())
print(countermeasures_df["Implementing State/Province"].unique())<jupyter_output>[nan 'Quang Ninh' 'Gyeongbook Province' 'Daegu, Gyeongbook Province'
 'Busan' 'Hubei' 'Hunan' 'Tianjin' 'Zheijang' 'Meituan' 'Chongqing'
 'Zhejian' 'Shanghai' 'Sichuan' 'Jiangsu' 'Guangdong' 'Hangzhou'
 'Shenzhen' 'Leishenshan' 'Guangzhou' 'Kanagawa prefecture' 'Guangxi'
 'Guizhou' 'Huanggang' 'Henan, Shandong' 'Liaoning, Shandong' 'Shandong'
 'Madrid' 'Tyrol' 'Basque Country' 'Galicia' 'Republika Srpska' 'Bosnia'
 'Autonomous Region of Madeira' 'California' 'Leningrad Oblast'
 'Moscow Oblast' 'St. Petersburg Oblast' 'Santa Clara County' 'Seattle'
 'Berkley, Countra Costa Country, Santa Clara County, los Angles'
 'Orange County' 'Placer County, San Mateo County, Sonoma County'
 'San Benito County, Santa Clara County'
 'Kershan County, Lancaster County' 'Bavaria' 'Colima' 'Mexico City'
 'South Fulton' 'Atalanta, Brookhaven, Clarkston, Dunwoody' 'Atalanta'
 'Albany, Athens-Clark county, Bosnia, Dougherty County'
 'Gyeonggi-Province, Paju' 'Gyeonggi-Province, Seoul'
 'Farifax county, Loud[...]<jupyter_text><NAME> containment measures databaseThe data is made available as part of the John Hopkins [Containment Measures Database](http://epidemicforecasting.org/containment). See the website in the link for a description of the data sources.<jupyter_code>containment_df = pd.read_csv("data/countermeasures_db_johnshopkins_2020_03_30.csv")
containment_df.columns
print(containment_df["Country"].unique())
cases_df = containment_df[["Date", "Country", "Confirmed Cases", "Deaths"]]\
.loc[containment_df["Confirmed Cases"] > 3000]\
.pivot(index="Date", columns="Country", values="Confirmed Cases")
cases_df.plot(figsize=(16,8), title="Per-country growth in confirmed cases after the first 3000")\
.legend(bbox_to_anchor=(1,1))
deaths_df = containment_df[["Date", "Country", "Confirmed Cases", "Deaths"]]\
.loc[containment_df["Deaths"] > 100]\
.pivot(index="Date", columns="Country", values="Deaths")
deaths_df.plot(figsize=(16,8), title="Deaths per country after the first 100 deaths recorded")\
.legend(bbox_to_anchor=(1,1))
other_cm_cols = ['Unnamed: 0', 'Resumption', 'Diagnostic criteria loosened', 'Testing criteria', 'Date', 'Country',
                 'Confirmed Cases', 'Deaths']
countermeasures = list(filter(lambda m: m not in other_cm_cols, containment_df.columns))
cm_df = containment_df[countermeasures + ['Date', 'Country']].fillna(0)
cm_df[countermeasures] = cm_df[countermeasures].mask(cm_df[countermeasures] > 0, 1)
cm_df.groupby("Date").sum().plot(figsize=(16,8), title="Number of countries implementing measure by date")\
.legend(bbox_to_anchor=(1,1))<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14002403846153846, 'fraction_numerical': 0.021334134615384616, 'mean_word_length': 7.924932975871314, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 12, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '667965', 'license': 'MIT', 'n_tokens_mistral': 1222, 'n_tokens_neox': 1110, 'n_words': 266, 'path': 'notebooks/data_sources.ipynb', 'repo_name': 'braadbaart/covid19', 'size': '3334'}