peak days of five 2020 Wikipedia articles
This commit is contained in:
commit
4957123bea
1 changed files with 393 additions and 0 deletions
9
analysis.py
Normal file
9
analysis.py
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
df = pd.read_csv("pageviews-2020.csv", parse_dates=["date"], index_col="date")
|
||||
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)")
|
||||
Loading…
Reference in a new issue