Tweak graph
This commit is contained in:
parent
77548a6de8
commit
cb12407d8e
1 changed files with 7 additions and 1 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue