From d8d4d7a4409ebcbc5ddf5f9f736086da82fd23e4 Mon Sep 17 00:00:00 2001 From: sowieso Date: Sat, 7 Aug 2021 11:58:55 +0200 Subject: [PATCH] Dirty fix for infection status indicator Mean over the last 7 days was distored when data for current day was missing. Fixed the issue by using mean of the last 7 days starting from yesterday. Better fix would be to use the 7 day mean of the last 7 datapoints available, to get most actual result. --- all_countries.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/all_countries.py b/all_countries.py index 20c47f2..8d42330 100644 --- a/all_countries.py +++ b/all_countries.py @@ -79,7 +79,7 @@ def plot(data, countries, pop, metadata={}, **kwargs): warn_thresh = 500e-6 * pop[loc]['pop']/7 info_thresh = 50e-6 * pop[loc]['pop']/7 low_thresh = 5e-6 * pop[loc]['pop']/7 - actual_level = np.mean(new_cases[-7:]) + actual_level = np.mean(new_cases[-8:-2]) infection_level_indicator = "green" if actual_level > low_thresh: infection_level_indicator = "gold"