Compare commits
3 commits
548eebfc96
...
fc650e1207
Author | SHA1 | Date | |
---|---|---|---|
|
fc650e1207 | ||
|
0e0ad8bc0f | ||
|
e13e8f1df6 |
2 changed files with 128 additions and 118 deletions
|
@ -22,6 +22,8 @@
|
||||||
<p class="data-text">
|
<p class="data-text">
|
||||||
Gestern wurden <em>{{ '{:n}'.format(data_first_vaccination.vaccinations_last_day).replace('.', ' ') }}</em> Erstimpfungen vorgenommen (<em>{{ '{:.3n}'.format(data_first_vaccination.vaccinations_last_day_percentage) }} %</em> der Bevölkerung, <em>{{ '{:.3n}'.format(data_first_vaccination.vaccinations_last_day_vaccination_percentage) }} %</em> der verabreichten Erstimpfdosen).
|
Gestern wurden <em>{{ '{:n}'.format(data_first_vaccination.vaccinations_last_day).replace('.', ' ') }}</em> Erstimpfungen vorgenommen (<em>{{ '{:.3n}'.format(data_first_vaccination.vaccinations_last_day_percentage) }} %</em> der Bevölkerung, <em>{{ '{:.3n}'.format(data_first_vaccination.vaccinations_last_day_vaccination_percentage) }} %</em> der verabreichten Erstimpfdosen).
|
||||||
Innerhalb der letzten Kalenderwoche sind <em>{{ '{:.9n}'.format(data_first_vaccination.vaccinations_last_week).replace('.', ' ') }}</em> Erstimpfungen erfolgt (<em>{{ '{:.3n}'.format(data_first_vaccination.vaccinations_last_week_percentage) }} %</em>, <em>{{ '{:.3n}'.format(data_first_vaccination.vaccinations_last_week_vaccination_percentage) }} %</em>).
|
Innerhalb der letzten Kalenderwoche sind <em>{{ '{:.9n}'.format(data_first_vaccination.vaccinations_last_week).replace('.', ' ') }}</em> Erstimpfungen erfolgt (<em>{{ '{:.3n}'.format(data_first_vaccination.vaccinations_last_week_percentage) }} %</em>, <em>{{ '{:.3n}'.format(data_first_vaccination.vaccinations_last_week_vaccination_percentage) }} %</em>).
|
||||||
|
Es wurden außerdem <em>{{ '{:n}'.format(data_second_vaccination.vaccinations_last_day).replace('.', ' ') }}</em> Zweitimpfungen vorgenommen (<em>{{ '{:.3n}'.format(data_second_vaccination.vaccinations_last_day_percentage) }} %</em> der Bevölkerung, <em>{{ '{:.3n}'.format(data_second_vaccination.vaccinations_last_day_vaccination_percentage) }} %</em> der verabreichten Erstimpfdosen).
|
||||||
|
Innerhalb der letzten Kalenderwoche sind <em>{{ '{:.9n}'.format(data_second_vaccination.vaccinations_last_week).replace('.', ' ') }}</em> Zweitimpfungen erfolgt (<em>{{ '{:.3n}'.format(data_second_vaccination.vaccinations_last_week_percentage) }} %</em>, <em>{{ '{:.3n}'.format(data_second_vaccination.vaccinations_last_week_vaccination_percentage) }} %</em>).
|
||||||
</p>
|
</p>
|
||||||
<p class="data-text">
|
<p class="data-text">
|
||||||
In den letzten sieben Tagen wurden durchschnittlich <em>{{ '{:n}'.format(data_first_vaccination['extrapolation_mean_seven_days']['rate_int']).replace('.', ' ') }}</em> Erstimpfungen und <em>{{ '{:n}'.format(data_second_vaccination['extrapolation_mean_seven_days']['rate_int']).replace('.', ' ') }}</em> Zweitimpfungen pro Tag vorgenommen (<em>{{ '{:n}'.format(data_first_vaccination['extrapolation_mean_seven_days']['rate_int'] * 7).replace('.', ' ') }}</em>/<em>{{ '{:n}'.format(data_second_vaccination['extrapolation_mean_seven_days']['rate_int'] * 7).replace('.', ' ') }}</em> pro Woche).
|
In den letzten sieben Tagen wurden durchschnittlich <em>{{ '{:n}'.format(data_first_vaccination['extrapolation_mean_seven_days']['rate_int']).replace('.', ' ') }}</em> Erstimpfungen und <em>{{ '{:n}'.format(data_second_vaccination['extrapolation_mean_seven_days']['rate_int']).replace('.', ' ') }}</em> Zweitimpfungen pro Tag vorgenommen (<em>{{ '{:n}'.format(data_first_vaccination['extrapolation_mean_seven_days']['rate_int'] * 7).replace('.', ' ') }}</em>/<em>{{ '{:n}'.format(data_second_vaccination['extrapolation_mean_seven_days']['rate_int'] * 7).replace('.', ' ') }}</em> pro Woche).
|
||||||
|
|
244
plot.py
244
plot.py
|
@ -52,150 +52,158 @@ plt.rcParams["figure.figsize"] = [11.69, 8.27]
|
||||||
|
|
||||||
# Download
|
# Download
|
||||||
|
|
||||||
data_filename = '{}/{}_Impfquotenmonitoring.xlsx'.format(data_folder, filename_now)
|
def download_rki(filename_prefix):
|
||||||
|
data_filename = '{}/{}_Impfquotenmonitoring.xlsx'.format(data_folder, filename_prefix)
|
||||||
|
|
||||||
r = req.get('https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile')
|
r = req.get('https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile')
|
||||||
|
|
||||||
with open(data_filename, 'wb') as outfile:
|
with open(data_filename, 'wb') as outfile:
|
||||||
outfile.write(r.content)
|
outfile.write(r.content)
|
||||||
|
|
||||||
#data_filename = 'data/20210118151908_Impfquotenmonitoring.xlsx'
|
return data_filename
|
||||||
|
|
||||||
rki_file = pd.read_excel(data_filename, sheet_name=None, engine='openpyxl')
|
data_filename = download_rki(filename_now)
|
||||||
|
|
||||||
raw_data = rki_file['Impfungen_proTag']
|
def parse_rki(filename):
|
||||||
|
|
||||||
impfungen = raw_data[:-1].dropna(subset=['Datum']).fillna(0)
|
rki_file = pd.read_excel(filename, sheet_name=None, engine='openpyxl')
|
||||||
|
|
||||||
impfungen.drop(impfungen.tail(1).index,inplace=True) # remove Gesamt row
|
raw_data = rki_file['Impfungen_proTag']
|
||||||
|
|
||||||
dates = impfungen['Datum']
|
impfungen = raw_data[:-1].dropna(subset=['Datum']).fillna(0)
|
||||||
|
|
||||||
start_of_reporting_date = dates.iloc[0].date()
|
impfungen.drop(impfungen.tail(1).index,inplace=True) # remove Gesamt row
|
||||||
|
|
||||||
def calculate_vaccination_data(data):
|
dates = impfungen['Datum']
|
||||||
|
|
||||||
total = int(np.sum(data))
|
start_of_reporting_date = dates.iloc[0].date()
|
||||||
total_percentage = float(total) / einwohner_deutschland * 100
|
|
||||||
|
|
||||||
to_be_vaccinated = einwohner_deutschland - total
|
def calculate_vaccination_data(data):
|
||||||
|
|
||||||
last_date = dates.iloc[-1].date()
|
total = int(np.sum(data))
|
||||||
start_of_vaccination_index = (data != 0).argmax(axis=0)
|
total_percentage = float(total) / einwohner_deutschland * 100
|
||||||
start_of_vaccination_date = dates[start_of_vaccination_index].date()
|
|
||||||
days_since_start_of_vaccination = (last_date - start_of_vaccination_date).days
|
|
||||||
days_since_start_of_reporting = (last_date - start_of_reporting_date).days
|
|
||||||
|
|
||||||
valid_data = data[start_of_vaccination_index:]
|
to_be_vaccinated = einwohner_deutschland - total
|
||||||
|
|
||||||
cumulative = np.concatenate(([math.nan] * (days_since_start_of_reporting - days_since_start_of_vaccination), np.cumsum(valid_data)))
|
last_date = dates.iloc[-1].date()
|
||||||
|
start_of_vaccination_index = (data != 0).argmax(axis=0)
|
||||||
|
start_of_vaccination_date = dates[start_of_vaccination_index].date()
|
||||||
|
days_since_start_of_vaccination = (last_date - start_of_vaccination_date).days
|
||||||
|
days_since_start_of_reporting = (last_date - start_of_reporting_date).days
|
||||||
|
|
||||||
mean_all_time = np.mean(valid_data)
|
valid_data = data[start_of_vaccination_index:]
|
||||||
mean_seven_days = np.mean(data[-7:])
|
|
||||||
|
|
||||||
vaccinations_by_week_map = map(lambda x: (Week.withdate(x[0]), x[1]), zip(dates, data))
|
cumulative = np.concatenate(([math.nan] * (days_since_start_of_reporting - days_since_start_of_vaccination), np.cumsum(valid_data)))
|
||||||
|
|
||||||
vaccinations_by_week = {}
|
mean_all_time = np.mean(valid_data)
|
||||||
|
mean_seven_days = np.mean(data[-7:])
|
||||||
|
|
||||||
for w, v in vaccinations_by_week_map:
|
vaccinations_by_week_map = map(lambda x: (Week.withdate(x[0]), x[1]), zip(dates, data))
|
||||||
if w in vaccinations_by_week:
|
|
||||||
vaccinations_by_week[w] = vaccinations_by_week[w] + v
|
vaccinations_by_week = {}
|
||||||
else:
|
|
||||||
vaccinations_by_week[w] = v
|
for w, v in vaccinations_by_week_map:
|
||||||
|
if w in vaccinations_by_week:
|
||||||
|
vaccinations_by_week[w] = vaccinations_by_week[w] + v
|
||||||
|
else:
|
||||||
|
vaccinations_by_week[w] = v
|
||||||
|
|
||||||
|
def extrapolate(rate, to_be_vaccinated):
|
||||||
|
days_extrapolated = int(np.ceil(to_be_vaccinated / rate))
|
||||||
|
days_extrapolated_herd_immunity = int(np.ceil((einwohner_deutschland * herd_immunity - total) / rate))
|
||||||
|
|
||||||
|
weeks_extrapolated = int(np.ceil(days_extrapolated / 7))
|
||||||
|
weeks_extrapolated_herd_immunity = int(np.ceil(days_extrapolated_herd_immunity / 7))
|
||||||
|
|
||||||
|
date_done = today + datetime.timedelta(days_extrapolated)
|
||||||
|
date_herd_immunity = today + datetime.timedelta(days_extrapolated_herd_immunity)
|
||||||
|
|
||||||
|
extrapolated_vaccinations = total + rate * range(-days_since_start_of_reporting, days_extrapolated - days_since_start_of_reporting)
|
||||||
|
|
||||||
|
return {
|
||||||
|
'rate': rate,
|
||||||
|
'rate_int': int(np.round(rate)),
|
||||||
|
'days_extrapolated': days_extrapolated,
|
||||||
|
'days_extrapolated_herd_immunity': days_extrapolated_herd_immunity,
|
||||||
|
'weeks_extrapolated': weeks_extrapolated,
|
||||||
|
'weeks_extrapolated_herd_immunity': weeks_extrapolated_herd_immunity,
|
||||||
|
'date_done': date_done,
|
||||||
|
'date_done_str': date_done.strftime('%d. %B %Y'),
|
||||||
|
'date_herd_immunity': date_herd_immunity,
|
||||||
|
'date_herd_immunity_str': date_herd_immunity.strftime('%d. %B %Y'),
|
||||||
|
'extrapolated_vaccinations': extrapolated_vaccinations
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
def extrapolate(rate, to_be_vaccinated):
|
extrapolation_mean_all_time = extrapolate(mean_all_time, to_be_vaccinated)
|
||||||
days_extrapolated = int(np.ceil(to_be_vaccinated / rate))
|
extrapolation_last_rate = extrapolate(data.iloc[-1], to_be_vaccinated)
|
||||||
days_extrapolated_herd_immunity = int(np.ceil((einwohner_deutschland * 0.7 - total) / rate))
|
extrapolation_mean_seven_days = extrapolate(mean_seven_days, to_be_vaccinated)
|
||||||
|
|
||||||
weeks_extrapolated = int(np.ceil(days_extrapolated / 7))
|
mean_vaccination_rates_daily = np.round(cumulative / range(1, len(cumulative) + 1))
|
||||||
weeks_extrapolated_herd_immunity = int(np.ceil(days_extrapolated_herd_immunity / 7))
|
vaccination_rates_daily_rolling_average = data.rolling(7).mean()
|
||||||
|
|
||||||
date_done = today + datetime.timedelta(days_extrapolated)
|
vaccinations_missing_until_target = einwohner_deutschland * herd_immunity - total
|
||||||
date_herd_immunity = today + datetime.timedelta(days_extrapolated_herd_immunity)
|
vaccination_rate_needed_for_target = vaccinations_missing_until_target / days_until_target
|
||||||
|
vaccination_rate_needed_for_target_percentage = mean_all_time / vaccination_rate_needed_for_target * 100
|
||||||
extrapolated_vaccinations = total + rate * range(-days_since_start_of_reporting, days_extrapolated - days_since_start_of_reporting)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'rate': rate,
|
'daily': data,
|
||||||
'rate_int': int(np.round(rate)),
|
'cumulative': cumulative,
|
||||||
'days_extrapolated': days_extrapolated,
|
'total': total,
|
||||||
'days_extrapolated_herd_immunity': days_extrapolated_herd_immunity,
|
'total_percentage': total_percentage,
|
||||||
'weeks_extrapolated': weeks_extrapolated,
|
'to_be_vaccinated': to_be_vaccinated,
|
||||||
'weeks_extrapolated_herd_immunity': weeks_extrapolated_herd_immunity,
|
'last_date': last_date,
|
||||||
'date_done': date_done,
|
'last_date_str': last_date.strftime('%d. %B %Y'),
|
||||||
'date_done_str': date_done.strftime('%d. %B %Y'),
|
'days_since_start': days_since_start_of_vaccination + 1, # Shift from zero to one-based-index
|
||||||
'date_herd_immunity': date_herd_immunity,
|
'start_of_vaccination_date': start_of_vaccination_date,
|
||||||
'date_herd_immunity_str': date_herd_immunity.strftime('%d. %B %Y'),
|
'start_of_vaccination_date_str': start_of_vaccination_date.strftime('%d. %B %Y'),
|
||||||
'extrapolated_vaccinations': extrapolated_vaccinations
|
'vaccinations_by_week': vaccinations_by_week,
|
||||||
|
'extrapolation_mean_all_time': extrapolation_mean_all_time,
|
||||||
|
'extrapolation_last_rate': extrapolation_last_rate,
|
||||||
|
'extrapolation_mean_seven_days': extrapolation_mean_seven_days,
|
||||||
|
'mean_vaccination_rates_daily': mean_vaccination_rates_daily,
|
||||||
|
'vaccination_rates_daily_rolling_average': vaccination_rates_daily_rolling_average,
|
||||||
|
'vaccinations_missing_until_target': int(np.floor(vaccinations_missing_until_target)),
|
||||||
|
'vaccination_rate_needed_for_target': int(np.floor(vaccination_rate_needed_for_target)),
|
||||||
|
'vaccination_rate_needed_for_target_percentage': vaccination_rate_needed_for_target_percentage,
|
||||||
|
'vaccinations_last_day': data.iloc[-1],
|
||||||
|
'vaccinations_last_day_percentage': data.iloc[-1] / einwohner_deutschland * 100,
|
||||||
|
'vaccinations_last_day_vaccination_percentage': data.iloc[-1] / total * 100,
|
||||||
|
'vaccinations_last_week': vaccinations_by_week[Week.thisweek() - 1],
|
||||||
|
'vaccinations_last_week_percentage': vaccinations_by_week[Week.thisweek() - 1] / einwohner_deutschland * 100,
|
||||||
|
'vaccinations_last_week_vaccination_percentage': vaccinations_by_week[Week.thisweek() - 1] / total * 100
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if 'Erstimpfung' in impfungen:
|
||||||
|
raw_first_vaccinations = impfungen['Erstimpfung']
|
||||||
|
elif 'Einmal geimpft' in impfungen:
|
||||||
|
raw_first_vaccinations = impfungen['Einmal geimpft']
|
||||||
|
elif 'Begonnene Impfserie' in impfungen:
|
||||||
|
raw_first_vaccinations = impfungen['Begonnene Impfserie']
|
||||||
|
|
||||||
extrapolation_mean_all_time = extrapolate(mean_all_time, to_be_vaccinated)
|
if 'Zweitimpfung' in impfungen:
|
||||||
extrapolation_last_rate = extrapolate(data.iloc[-1], to_be_vaccinated)
|
raw_second_vaccinations = impfungen['Zweitimpfung']
|
||||||
extrapolation_mean_seven_days = extrapolate(mean_seven_days, to_be_vaccinated)
|
elif 'Vollständig geimpft' in impfungen:
|
||||||
|
raw_second_vaccinations = impfungen['Vollständig geimpft']
|
||||||
|
|
||||||
mean_vaccination_rates_daily = np.round(cumulative / range(1, len(cumulative) + 1))
|
data_first_vaccination = calculate_vaccination_data(raw_first_vaccinations)
|
||||||
vaccination_rates_daily_rolling_average = data.rolling(7).mean()
|
data_second_vaccination = calculate_vaccination_data(raw_second_vaccinations)
|
||||||
|
|
||||||
vaccinations_missing_until_target = einwohner_deutschland * 0.7 - total
|
# Stand aus Daten auslesen
|
||||||
vaccination_rate_needed_for_target = vaccinations_missing_until_target / days_until_target
|
#stand = dates.iloc[-1]
|
||||||
vaccination_rate_needed_for_target_percentage = mean_all_time / vaccination_rate_needed_for_target * 100
|
#print_stand = stand.isoformat()
|
||||||
|
|
||||||
return {
|
# Stand aus offiziellen Angaben auslesen
|
||||||
'daily': data,
|
stand = rki_file['Erläuterung'].iloc[1][0]
|
||||||
'cumulative': cumulative,
|
|
||||||
'total': total,
|
|
||||||
'total_percentage': total_percentage,
|
|
||||||
'to_be_vaccinated': to_be_vaccinated,
|
|
||||||
'last_date': last_date,
|
|
||||||
'last_date_str': last_date.strftime('%d. %B %Y'),
|
|
||||||
'days_since_start': days_since_start_of_vaccination + 1, # Shift from zero to one-based-index
|
|
||||||
'start_of_vaccination_date': start_of_vaccination_date,
|
|
||||||
'start_of_vaccination_date_str': start_of_vaccination_date.strftime('%d. %B %Y'),
|
|
||||||
'vaccinations_by_week': vaccinations_by_week,
|
|
||||||
'extrapolation_mean_all_time': extrapolation_mean_all_time,
|
|
||||||
'extrapolation_last_rate': extrapolation_last_rate,
|
|
||||||
'extrapolation_mean_seven_days': extrapolation_mean_seven_days,
|
|
||||||
'mean_vaccination_rates_daily': mean_vaccination_rates_daily,
|
|
||||||
'vaccination_rates_daily_rolling_average': vaccination_rates_daily_rolling_average,
|
|
||||||
'vaccinations_missing_until_target': int(np.floor(vaccinations_missing_until_target)),
|
|
||||||
'vaccination_rate_needed_for_target': int(np.floor(vaccination_rate_needed_for_target)),
|
|
||||||
'vaccination_rate_needed_for_target_percentage': vaccination_rate_needed_for_target_percentage,
|
|
||||||
'vaccinations_last_day': data.iloc[-1],
|
|
||||||
'vaccinations_last_day_percentage': data.iloc[-1] / einwohner_deutschland * 100,
|
|
||||||
'vaccinations_last_day_vaccination_percentage': data.iloc[-1] / total * 100,
|
|
||||||
'vaccinations_last_week': vaccinations_by_week[Week.thisweek() - 1],
|
|
||||||
'vaccinations_last_week_percentage': vaccinations_by_week[Week.thisweek() - 1] / einwohner_deutschland * 100,
|
|
||||||
'vaccinations_last_week_vaccination_percentage': vaccinations_by_week[Week.thisweek() - 1] / total * 100
|
|
||||||
}
|
|
||||||
|
|
||||||
if 'Erstimpfung' in impfungen:
|
stand_regex = re.compile('^Datenstand: (\d\d.\d\d.\d\d\d\d, \d?\d:\d\d) Uhr$')
|
||||||
raw_first_vaccinations = impfungen['Erstimpfung']
|
m = stand_regex.match(stand)
|
||||||
elif 'Einmal geimpft' in impfungen:
|
stand_date = datetime.datetime.strptime(m.groups()[0], '%d.%m.%Y, %H:%M')
|
||||||
raw_first_vaccinations = impfungen['Einmal geimpft']
|
print_stand = stand_date.isoformat()
|
||||||
elif 'Begonnene Impfserie' in impfungen:
|
|
||||||
raw_first_vaccinations = impfungen['Begonnene Impfserie']
|
|
||||||
|
|
||||||
if 'Zweitimpfung' in impfungen:
|
return dates, start_of_reporting_date, data_first_vaccination, data_second_vaccination, stand_date, print_stand
|
||||||
raw_second_vaccinations = impfungen['Zweitimpfung']
|
|
||||||
elif 'Vollständig geimpft' in impfungen:
|
|
||||||
raw_second_vaccinations = impfungen['Vollständig geimpft']
|
|
||||||
|
|
||||||
data_first_vaccination = calculate_vaccination_data(raw_first_vaccinations)
|
dates, start_of_reporting_date, data_first_vaccination, data_second_vaccination, stand_date, print_stand = parse_rki(filename=data_filename)
|
||||||
data_second_vaccination = calculate_vaccination_data(raw_second_vaccinations)
|
|
||||||
|
|
||||||
# Stand aus Daten auslesen
|
|
||||||
#stand = dates.iloc[-1]
|
|
||||||
#print_stand = stand.isoformat()
|
|
||||||
|
|
||||||
# Stand aus offiziellen Angaben auslesen
|
|
||||||
stand = rki_file['Erläuterung'].iloc[1][0]
|
|
||||||
|
|
||||||
stand_regex = re.compile('^Datenstand: (\d\d.\d\d.\d\d\d\d, \d?\d:\d\d) Uhr$')
|
|
||||||
m = stand_regex.match(stand)
|
|
||||||
stand_date = datetime.datetime.strptime(m.groups()[0], '%d.%m.%Y, %H:%M')
|
|
||||||
print_stand = stand_date.isoformat()
|
|
||||||
|
|
||||||
filename_stand = stand_date.strftime("%Y%m%d%H%M%S")
|
filename_stand = stand_date.strftime("%Y%m%d%H%M%S")
|
||||||
|
|
||||||
|
@ -678,8 +686,8 @@ def plot_vaccination_done_days():
|
||||||
)
|
)
|
||||||
d = data_first_vaccination
|
d = data_first_vaccination
|
||||||
|
|
||||||
days_remaining_daily = np.ceil((einwohner_deutschland * 0.7 - d['cumulative']) / (d['mean_vaccination_rates_daily']))
|
days_remaining_daily = np.ceil((einwohner_deutschland * herd_immunity - d['cumulative']) / (d['mean_vaccination_rates_daily']))
|
||||||
days_remaining_rolling = np.ceil((einwohner_deutschland * 0.7 - d['cumulative']) / (d['vaccination_rates_daily_rolling_average']))
|
days_remaining_rolling = np.ceil((einwohner_deutschland * herd_immunity - d['cumulative']) / (d['vaccination_rates_daily_rolling_average']))
|
||||||
|
|
||||||
ax.set_xlim(start_of_reporting_date, today)
|
ax.set_xlim(start_of_reporting_date, today)
|
||||||
ax.set_ylim(0, 2500)
|
ax.set_ylim(0, 2500)
|
||||||
|
@ -722,8 +730,8 @@ def plot_vaccination_done_weeks():
|
||||||
)
|
)
|
||||||
d = data_first_vaccination
|
d = data_first_vaccination
|
||||||
|
|
||||||
weeks_remaining_daily = np.ceil((einwohner_deutschland * 0.7 - d['cumulative']) / (d['mean_vaccination_rates_daily'])) / 7
|
weeks_remaining_daily = np.ceil((einwohner_deutschland * herd_immunity - d['cumulative']) / (d['mean_vaccination_rates_daily'])) / 7
|
||||||
weeks_remaining_rolling = np.ceil((einwohner_deutschland * 0.7 - d['cumulative']) / (d['vaccination_rates_daily_rolling_average'])) / 7
|
weeks_remaining_rolling = np.ceil((einwohner_deutschland * herd_immunity - d['cumulative']) / (d['vaccination_rates_daily_rolling_average'])) / 7
|
||||||
|
|
||||||
ax.set_xlim(datetime.date(2021, 3, 1), today)
|
ax.set_xlim(datetime.date(2021, 3, 1), today)
|
||||||
ax.set_ylim(0, 52)
|
ax.set_ylim(0, 52)
|
||||||
|
@ -765,8 +773,8 @@ def plot_vaccination_done_dates():
|
||||||
)
|
)
|
||||||
d = data_first_vaccination
|
d = data_first_vaccination
|
||||||
|
|
||||||
days_remaining_daily = np.ceil((einwohner_deutschland * 0.7 - d['cumulative']) / (d['mean_vaccination_rates_daily']))
|
days_remaining_daily = np.ceil((einwohner_deutschland * herd_immunity - d['cumulative']) / (d['mean_vaccination_rates_daily']))
|
||||||
days_remaining_rolling = np.ceil((einwohner_deutschland * 0.7 - d['cumulative']) / (d['vaccination_rates_daily_rolling_average']))
|
days_remaining_rolling = np.ceil((einwohner_deutschland * herd_immunity - d['cumulative']) / (d['vaccination_rates_daily_rolling_average']))
|
||||||
|
|
||||||
dates_daily = [today + datetime.timedelta(days) for days in days_remaining_daily]
|
dates_daily = [today + datetime.timedelta(days) for days in days_remaining_daily]
|
||||||
dates_rolling = [today + datetime.timedelta(days) for days in days_remaining_rolling.dropna()]
|
dates_rolling = [today + datetime.timedelta(days) for days in days_remaining_rolling.dropna()]
|
||||||
|
@ -811,8 +819,8 @@ def plot_vaccination_done_dates_detail():
|
||||||
)
|
)
|
||||||
d = data_first_vaccination
|
d = data_first_vaccination
|
||||||
|
|
||||||
days_remaining_daily = np.ceil((einwohner_deutschland * 0.7 - d['cumulative']) / (d['mean_vaccination_rates_daily']))
|
days_remaining_daily = np.ceil((einwohner_deutschland * herd_immunity - d['cumulative']) / (d['mean_vaccination_rates_daily']))
|
||||||
days_remaining_rolling = np.ceil((einwohner_deutschland * 0.7 - d['cumulative']) / (d['vaccination_rates_daily_rolling_average']))
|
days_remaining_rolling = np.ceil((einwohner_deutschland * herd_immunity - d['cumulative']) / (d['vaccination_rates_daily_rolling_average']))
|
||||||
|
|
||||||
dates_daily = [today + datetime.timedelta(days) for days in days_remaining_daily]
|
dates_daily = [today + datetime.timedelta(days) for days in days_remaining_daily]
|
||||||
dates_rolling = [today + datetime.timedelta(days) for days in days_remaining_rolling.dropna()]
|
dates_rolling = [today + datetime.timedelta(days) for days in days_remaining_rolling.dropna()]
|
||||||
|
|
Loading…
Reference in a new issue