new data sheet length, added people_fully_vaccinated
This commit is contained in:
10
coronavis.py
10
coronavis.py
@@ -108,6 +108,8 @@ def get_data():
|
|||||||
iso_code, continent, location, date, total_cases, new_cases, new_cases_smoothed, total_deaths, new_deaths, new_deaths_smoothed, total_cases_per_million, new_cases_per_million, new_cases_smoothed_per_million, total_deaths_per_million, new_deaths_per_million, new_deaths_smoothed_per_million, reproduction_rate, icu_patients, icu_patients_per_million, hosp_patients, hosp_patients_per_million, weekly_icu_admissions, weekly_icu_admissions_per_million, weekly_hosp_admissions, weekly_hosp_admissions_per_million, new_tests, total_tests, total_tests_per_thousand, new_tests_per_thousand, new_tests_smoothed, new_tests_smoothed_per_thousand, positive_rate, tests_per_case, tests_units, total_vaccinations, new_vaccinations, total_vaccinations_per_hundred, new_vaccinations_per_million, stringency_index, population, population_density, median_age, aged_65_older, aged_70_older, gdp_per_capita, extreme_poverty, cardiovasc_death_rate, diabetes_prevalence, female_smokers, male_smokers, handwashing_facilities, hospital_beds_per_thousand, life_expectancy, human_development_index = row
|
iso_code, continent, location, date, total_cases, new_cases, new_cases_smoothed, total_deaths, new_deaths, new_deaths_smoothed, total_cases_per_million, new_cases_per_million, new_cases_smoothed_per_million, total_deaths_per_million, new_deaths_per_million, new_deaths_smoothed_per_million, reproduction_rate, icu_patients, icu_patients_per_million, hosp_patients, hosp_patients_per_million, weekly_icu_admissions, weekly_icu_admissions_per_million, weekly_hosp_admissions, weekly_hosp_admissions_per_million, new_tests, total_tests, total_tests_per_thousand, new_tests_per_thousand, new_tests_smoothed, new_tests_smoothed_per_thousand, positive_rate, tests_per_case, tests_units, total_vaccinations, new_vaccinations, total_vaccinations_per_hundred, new_vaccinations_per_million, stringency_index, population, population_density, median_age, aged_65_older, aged_70_older, gdp_per_capita, extreme_poverty, cardiovasc_death_rate, diabetes_prevalence, female_smokers, male_smokers, handwashing_facilities, hospital_beds_per_thousand, life_expectancy, human_development_index = row
|
||||||
elif len(row) == 55:
|
elif len(row) == 55:
|
||||||
iso_code, continent, location, date, total_cases, new_cases, new_cases_smoothed, total_deaths, new_deaths, new_deaths_smoothed, total_cases_per_million, new_cases_per_million, new_cases_smoothed_per_million, total_deaths_per_million, new_deaths_per_million, new_deaths_smoothed_per_million, reproduction_rate, icu_patients, icu_patients_per_million, hosp_patients, hosp_patients_per_million, weekly_icu_admissions, weekly_icu_admissions_per_million, weekly_hosp_admissions, weekly_hosp_admissions_per_million, new_tests, total_tests, total_tests_per_thousand, new_tests_per_thousand, new_tests_smoothed, new_tests_smoothed_per_thousand, positive_rate, tests_per_case, tests_units, total_vaccinations, new_vaccinations, new_vaccinations_smoothed, total_vaccinations_per_hundred, new_vaccinations_smoothed_per_million, stringency_index, population, population_density, median_age, aged_65_older, aged_70_older, gdp_per_capita, extreme_poverty, cardiovasc_death_rate, diabetes_prevalence, female_smokers, male_smokers, handwashing_facilities, hospital_beds_per_thousand, life_expectancy, human_development_index = row
|
iso_code, continent, location, date, total_cases, new_cases, new_cases_smoothed, total_deaths, new_deaths, new_deaths_smoothed, total_cases_per_million, new_cases_per_million, new_cases_smoothed_per_million, total_deaths_per_million, new_deaths_per_million, new_deaths_smoothed_per_million, reproduction_rate, icu_patients, icu_patients_per_million, hosp_patients, hosp_patients_per_million, weekly_icu_admissions, weekly_icu_admissions_per_million, weekly_hosp_admissions, weekly_hosp_admissions_per_million, new_tests, total_tests, total_tests_per_thousand, new_tests_per_thousand, new_tests_smoothed, new_tests_smoothed_per_thousand, positive_rate, tests_per_case, tests_units, total_vaccinations, new_vaccinations, new_vaccinations_smoothed, total_vaccinations_per_hundred, new_vaccinations_smoothed_per_million, stringency_index, population, population_density, median_age, aged_65_older, aged_70_older, gdp_per_capita, extreme_poverty, cardiovasc_death_rate, diabetes_prevalence, female_smokers, male_smokers, handwashing_facilities, hospital_beds_per_thousand, life_expectancy, human_development_index = row
|
||||||
|
elif len(row) == 59:
|
||||||
|
iso_code, continent, location, date, total_cases, new_cases, new_cases_smoothed, total_deaths, new_deaths, new_deaths_smoothed, total_cases_per_million, new_cases_per_million, new_cases_smoothed_per_million, total_deaths_per_million, new_deaths_per_million, new_deaths_smoothed_per_million, reproduction_rate, icu_patients, icu_patients_per_million, hosp_patients, hosp_patients_per_million, weekly_icu_admissions, weekly_icu_admissions_per_million, weekly_hosp_admissions, weekly_hosp_admissions_per_million, total_tests, new_tests, total_tests_per_thousand, new_tests_per_thousand, new_tests_smoothed, new_tests_smoothed_per_thousand, positive_rate, tests_per_case, tests_units, total_vaccinations, people_vaccinated, people_fully_vaccinated, new_vaccinations, new_vaccinations_smoothed, total_vaccinations_per_hundred, people_vaccinated_per_hundred, people_fully_vaccinated_per_hundred, new_vaccinations_smoothed_per_million, stringency_index, population, population_density, median_age, aged_65_older, aged_70_older, gdp_per_capita, extreme_poverty, cardiovasc_death_rate, diabetes_prevalence, female_smokers, male_smokers, handwashing_facilities, hospital_beds_per_thousand, life_expectancy, human_development_index = row
|
||||||
else:
|
else:
|
||||||
print(f"WARNING! Table format changed, length now {len(row)}, new header:\n{row})")
|
print(f"WARNING! Table format changed, length now {len(row)}, new header:\n{row})")
|
||||||
exit(1)
|
exit(1)
|
||||||
@@ -123,6 +125,7 @@ def get_data():
|
|||||||
total_deaths = tofloat(total_deaths)
|
total_deaths = tofloat(total_deaths)
|
||||||
new_deaths = tofloat(new_deaths)
|
new_deaths = tofloat(new_deaths)
|
||||||
total_vaccinations = tofloat(total_vaccinations)
|
total_vaccinations = tofloat(total_vaccinations)
|
||||||
|
people_fully_vaccinated = tofloat(people_fully_vaccinated)
|
||||||
stringency_index = tofloat(stringency_index)
|
stringency_index = tofloat(stringency_index)
|
||||||
reproduction_rate = tofloat(reproduction_rate)
|
reproduction_rate = tofloat(reproduction_rate)
|
||||||
icu_patients = tofloat(icu_patients)
|
icu_patients = tofloat(icu_patients)
|
||||||
@@ -146,7 +149,7 @@ def get_data():
|
|||||||
stringency_index, reproduction_rate, icu_patients, hosp_patients,
|
stringency_index, reproduction_rate, icu_patients, hosp_patients,
|
||||||
weekly_icu_admissions, weekly_hosp_admissions, new_tests,
|
weekly_icu_admissions, weekly_hosp_admissions, new_tests,
|
||||||
total_tests, positive_rate, tests_per_case, tests_units,
|
total_tests, positive_rate, tests_per_case, tests_units,
|
||||||
new_vaccinations,]
|
new_vaccinations, people_fully_vaccinated]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -191,8 +194,9 @@ def get_data():
|
|||||||
tests_per_case = []
|
tests_per_case = []
|
||||||
tests_units = []
|
tests_units = []
|
||||||
new_vaccinations = []
|
new_vaccinations = []
|
||||||
|
people_fully_vaccinated = []
|
||||||
for entry in data[loc]:
|
for entry in data[loc]:
|
||||||
t_, new_cases_, new_deaths_, total_cases_, total_deaths_, total_vaccinations_, stringency_index_, reproduction_rate_, icu_patients_, hosp_patients_, weekly_icu_admissions_, weekly_hosp_admissions_, new_tests_, total_tests_, positive_rate_, tests_per_case_, tests_units_, new_vaccinations_ = entry
|
t_, new_cases_, new_deaths_, total_cases_, total_deaths_, total_vaccinations_, stringency_index_, reproduction_rate_, icu_patients_, hosp_patients_, weekly_icu_admissions_, weekly_hosp_admissions_, new_tests_, total_tests_, positive_rate_, tests_per_case_, tests_units_, new_vaccinations_, people_fully_vaccinated_ = entry
|
||||||
|
|
||||||
time.append(t_)
|
time.append(t_)
|
||||||
new_cases.append(toint(new_cases_))
|
new_cases.append(toint(new_cases_))
|
||||||
@@ -212,6 +216,7 @@ def get_data():
|
|||||||
tests_per_case.append(tests_per_case_)
|
tests_per_case.append(tests_per_case_)
|
||||||
new_vaccinations.append(toint(new_vaccinations_))
|
new_vaccinations.append(toint(new_vaccinations_))
|
||||||
tests_units.append(tests_units_)
|
tests_units.append(tests_units_)
|
||||||
|
people_fully_vaccinated.append(people_fully_vaccinated_)
|
||||||
|
|
||||||
### data tweaking and fixing goes here
|
### data tweaking and fixing goes here
|
||||||
|
|
||||||
@@ -243,6 +248,7 @@ def get_data():
|
|||||||
'tests_per_case': tests_per_case,
|
'tests_per_case': tests_per_case,
|
||||||
'tests_units': tests_units,
|
'tests_units': tests_units,
|
||||||
'new_vaccinations': new_vaccinations,
|
'new_vaccinations': new_vaccinations,
|
||||||
|
'people_fully_vaccinated': people_fully_vaccinated,
|
||||||
}
|
}
|
||||||
# add vaccine info to metadata
|
# add vaccine info to metadata
|
||||||
if loc in vaccines_country_dict:
|
if loc in vaccines_country_dict:
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ Ein Infoservice von <a href=dukun.de>dukun.de</a>; Anregungen gern <a href="mail
|
|||||||
positive_rate = data[loc]['positive_rate']
|
positive_rate = data[loc]['positive_rate']
|
||||||
tests_per_case = data[loc]['tests_per_case']
|
tests_per_case = data[loc]['tests_per_case']
|
||||||
tests_units = data[loc]['tests_units']
|
tests_units = data[loc]['tests_units']
|
||||||
|
people_fully_vaccinated = data[loc]['people_fully_vaccinated']
|
||||||
|
|
||||||
# plots
|
# plots
|
||||||
|
|
||||||
@@ -221,6 +222,8 @@ Ein Infoservice von <a href=dukun.de>dukun.de</a>; Anregungen gern <a href="mail
|
|||||||
ax1.plot(np.array(time), new_vaccinations, color="grey", linestyle="--", linewidth=1, label="new vaccinations")
|
ax1.plot(np.array(time), new_vaccinations, color="grey", linestyle="--", linewidth=1, label="new vaccinations")
|
||||||
if not np.isnan(total_vaccinations).all():
|
if not np.isnan(total_vaccinations).all():
|
||||||
ax2.plot(np.array(time), total_vaccinations, color="blue", linestyle="-", linewidth=1, label="total vaccinations")
|
ax2.plot(np.array(time), total_vaccinations, color="blue", linestyle="-", linewidth=1, label="total vaccinations")
|
||||||
|
if not np.isnan(people_fully_vaccinated).all():
|
||||||
|
ax2.plot(np.array(time), people_fully_vaccinated, color="green", linestyle="-", linewidth=1, label="people fully vaccinated")
|
||||||
|
|
||||||
immune_mask = ~np.isnan(total_vaccinations) & ~np.isnan(total_cases)
|
immune_mask = ~np.isnan(total_vaccinations) & ~np.isnan(total_cases)
|
||||||
assert len(total_vaccinations) == len(total_cases)
|
assert len(total_vaccinations) == len(total_cases)
|
||||||
|
|||||||
Reference in New Issue
Block a user