vaccination state corrected (first vs second dose), small cleanup

This commit is contained in:
fordprefect
2021-02-17 13:50:18 +01:00
parent aa8faf634e
commit 15784f7e72
3 changed files with 43 additions and 31 deletions

View File

@@ -224,6 +224,10 @@ def get_data():
for n in range(1, len(total_vaccinations)):
if np.isnan(total_vaccinations[n]) and not np.isnan(total_vaccinations[n-1]):
total_vaccinations[n] = total_vaccinations[n-1]
# fix vaccination data: not all countries report fully vaccinated
for n in range(1, len(people_fully_vaccinated)):
if np.isnan(people_fully_vaccinated[n]) and not np.isnan(people_fully_vaccinated[n-1]):
people_fully_vaccinated[n] = people_fully_vaccinated[n-1]
###
@@ -254,7 +258,7 @@ def get_data():
if loc in vaccines_country_dict:
metadata[loc]['vaccines'] = vaccines_country_dict[loc]
# cast population to int
if loc not in ("International", "Africa", "European Union", "Europe", "Asia", "North America", "South America", "Oceania"):
if loc not in ("International", "Africa", "European Union", "Europe", "Asia", "North America", "South America", "Oceania", "Northern Cyprus"):
try: metadata[loc]['population'] = int(float(metadata[loc]['population']))
except: metadata[loc][loc]['population'] = np.nan