From 4e43916fb1d6dba074797b4992d24dd99d0aaddb Mon Sep 17 00:00:00 2001 From: Felix Blanke Date: Mon, 28 Aug 2023 00:12:01 +0200 Subject: [PATCH] If no dataframe was yet created for the current day remove the entry for plotting purposes --- wsgi.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wsgi.py b/wsgi.py index f06c6e3..60d4958 100644 --- a/wsgi.py +++ b/wsgi.py @@ -83,6 +83,9 @@ def plot( sum_val = current_df[["Digitale Befragung"]].sum().iloc[0] df.loc[curr_datetime] = sum_val + if pd.isna(df.loc[df.index.max()][0]): + df = df.drop([df.index.max()]) + fig = plt.figure(dpi=300) # fill weekends