From cb12407d8ec9e00ce43562ce923479048d544f09 Mon Sep 17 00:00:00 2001 From: Joscha Date: Sat, 1 Mar 2025 04:24:17 +0100 Subject: [PATCH] Tweak graph --- activity_graph.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/activity_graph.py b/activity_graph.py index 93518fd..6db67e1 100644 --- a/activity_graph.py +++ b/activity_graph.py @@ -50,7 +50,13 @@ def main(): df = pd.DataFrame({"date": dates, "count": counts}) df.set_index("date", inplace=True) df = df.asfreq("D", fill_value=0) # Fill missing dates with 0 - df["30_day_avg"] = df["count"].rolling(window="30D", center=True).mean() + avg = df["count"].rolling( + window=30, + min_periods=1, + center=True, + win_type="gaussian", + ) + df["30_day_avg"] = avg.mean(std=8) # Create the plot fig, ax = plt.subplots(figsize=(10, 5))