From 3e9f00ec2b84a400e14281c953491271d0d83661 Mon Sep 17 00:00:00 2001 From: Benedikt Bastin Date: Tue, 18 May 2021 18:50:22 +0200 Subject: [PATCH] fix: More robust removal of rows without data (only comments) --- plot.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plot.py b/plot.py index b1634c0..27315df 100644 --- a/plot.py +++ b/plot.py @@ -39,7 +39,7 @@ print_today = today.isoformat() filename_now = datetime.datetime.now().strftime("%Y%m%d%H%M%S") force_renew_plots = False -force_renew_dashboard = False +force_renew_dashboard = True # https://www.tagesschau.de/ausland/europa/ursula-von-der-leyen-zu-corona-impfstoffen-101.html target_date_for_herd_immunity = datetime.date(2021, 9, 22) @@ -72,7 +72,10 @@ def parse_rki(filename): impfungen = raw_data[:-1].dropna(subset=['Datum']).fillna(0) - impfungen.drop(impfungen.tail(1).index,inplace=True) # remove Gesamt row + # Filter out rows without date in first column + impfungen['Datum'] = pd.to_datetime(impfungen['Datum'], errors='coerce') + impfungen = impfungen[pd.notna(impfungen['Datum'])] + dates = impfungen['Datum']