monthly totals, sourdough week, results
This commit is contained in:
parent
4957123bea
commit
743fb6f6cb
1 changed files with 33 additions and 0 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Reference in a new issue