monthly totals, sourdough week, results
This commit is contained in:
parent
4957123bea
commit
743fb6f6cb
2 changed files with 33 additions and 0 deletions
26
README.md
26
README.md
|
|
@ -13,3 +13,29 @@ users only, stored in `pageviews-2020.csv`.
|
||||||
$ pip install -r requirements.txt
|
$ pip install -r requirements.txt
|
||||||
$ python analysis.py
|
$ 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
|
||||||
|
```
|
||||||
|
|
|
||||||
|
|
@ -7,3 +7,10 @@ df = df.fillna(0).astype(np.int) # Tiger King did not exist before March
|
||||||
print("Peak day per article:")
|
print("Peak day per article:")
|
||||||
for article, views in df.iteritems():
|
for article, views in df.iteritems():
|
||||||
print(f" {article}: {views.idxmax():%d %b} ({views.max():,} views)")
|
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())
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue