From 743fb6f6cb36dab049df1801dca25b217ac58d8d Mon Sep 17 00:00:00 2001 From: Lockdown Data Club Date: Mon, 19 Jul 2021 21:07:00 +0200 Subject: [PATCH] monthly totals, sourdough week, results --- README.md | 26 ++++++++++++++++++++++++++ analysis.py | 7 +++++++ 2 files changed, 33 insertions(+) diff --git a/README.md b/README.md index a1edb16..f88af1d 100644 --- a/README.md +++ b/README.md @@ -13,3 +13,29 @@ users only, stored in `pageviews-2020.csv`. $ pip install -r requirements.txt $ python analysis.py ``` + +## Results (July 2021) + +```text +Peak day per article: + sourdough: 25 Apr (8,259 views) + zoom: 02 Apr (64,268 views) + animal_crossing: 20 Mar (56,874 views) + toilet_paper: 14 Mar (20,371 views) + tiger_king: 13 Apr (90,764 views) + sourdough zoom animal_crossing toilet_paper tiger_king +date +Jan 45878 26096 67677 21401 0 +Feb 48457 41342 122414 23451 0 +Mar 83580 663419 569682 222247 37275 +Apr 173947 1167813 404487 81741 1093494 +May 113579 560405 189318 38045 477599 +Jun 56083 636246 80066 21297 170962 +Jul 55808 425228 69326 18567 95743 +Aug 43561 363058 66470 18947 86376 +Sep 39491 412287 50449 19617 142133 +Oct 43855 344082 45804 20809 82092 +Nov 41821 334434 60014 23087 69950 +Dec 40565 302562 76310 20233 85661 +Sourdough's busiest calendar week: 18 +``` diff --git a/analysis.py b/analysis.py index ffcfda0..4db7ff4 100644 --- a/analysis.py +++ b/analysis.py @@ -7,3 +7,10 @@ df = df.fillna(0).astype(np.int) # Tiger King did not exist before March print("Peak day per article:") for article, views in df.iteritems(): print(f" {article}: {views.idxmax():%d %b} ({views.max():,} views)") + +monthly = df.resample("M").sum() +monthly.index = monthly.index.strftime("%b") +print(monthly) + +weekly = df["sourdough"].groupby(df.index.week).sum() +print("Sourdough's busiest calendar week:", weekly.idxmax())