Skip to content

Commit

Permalink
Fix z score
Browse files Browse the repository at this point in the history
  • Loading branch information
mas-4 authored May 29, 2024
1 parent 954e8b3 commit 30f6ca0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/site/page_headlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ def analyze_newsiness(self, df):
condition = (ndf['halfhour'] == halfhour) & (ndf['day'] == weekday)
try:
std = ndf[condition]['std'].values[0]
median = ndf[condition]['median'].values[0]
zscore = (newsiness - median) / std
mean = ndf[condition]['mean'].values[0]
zscore = (newsiness - mean) / std

if zscore > 1:
slowday = f'<h1 class="busy newsday">🚨🗞️🚨 BIG NEWS DAY! (z={zscore:.2f}) 🚨🗞️🚨</h1>'
Expand Down

0 comments on commit 30f6ca0

Please sign in to comment.