From d2ef9e2c11ac81b708d7c0b3fa462c257678587d Mon Sep 17 00:00:00 2001 From: Midgard Date: Fri, 16 Oct 2020 16:20:18 +0200 Subject: [PATCH] Other scoring: work with relative prevalence --- README | 40 ++++++++++++++++++++-------------------- whats_hot.py | 4 ++-- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/README b/README index 829a243..d398457 100644 --- a/README +++ b/README @@ -7,78 +7,78 @@ voor beter overzicht! Zeker doen. Fruit J F M A M J J A S O N D - ░ ░ █ █ ░ Stekelbes ▓ ▓ Cassisbes ▓ ▓ Kers - ▓ █ █ ▓ ░ ░ Rode bes - █ █ ▓ ░ Pruim + ░ ░ █ █ ░ Stekelbes ░ ░ ▓ █ █ █ █ █ █ ▓ ▓ ░ Aardbei + ▓ █ █ ▓ ░ ░ Rode bes +█ █ █ █ █ █ ▓ ▓ █ █ █ █ Appel +█ █ █ ▓ ▓ ▓ ░ ░ █ █ █ █ Peer ░ ▓ █ █ █ ▓ ▓ ▓ ░ Braambes + █ █ ▓ ░ Pruim ░ ▓ █ █ █ ▓ ▓ ░ Framboos ░ ▓ █ █ ▓ ▓ ▓ Blauwe bes ▓ ▓ ▓ ▓ Kweepeer ░ █ ▓ Kiwibes ▓ ▓ ▓ Veenbes -█ █ █ █ █ █ ▓ ▓ █ █ █ █ Appel -█ █ █ ▓ ▓ ▓ ░ ░ █ █ █ █ Peer Groenten J F M A M J J A S O N D - ░ ▓ ▓ █ ▓ ░ Asperge (wit) ▓ █ ▓ ░ Asperge (groen) + ░ ▓ ▓ █ ▓ ░ Asperge (wit) ░ █ ▓ ░ Erwtjes ░ ░ ▓ █ █ █ █ █ ▓ ░ ░ ░ Komkommer ░ ░ ▓ █ █ █ ▓ ▓ ░ ░ Aubergine ░ ▓ ▓ █ █ █ ▓ ░ Paprika ░ ░ ▓ █ █ █ ▓ ░ ░ Rabarber █ █ █ ▓ ░ ▓ █ Zoete aardappel - ░ ░ ▓ ▓ █ █ ▓ ░ Groene boontjes -▓ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ Sjalot -▓ ▓ ░ ░ ░ ▓ █ Aardpeer - ░ ▓ ▓ ▓ ▓ ░ Warmoes / snijbiet █ █ █ █ █ █ ▓ ░ ▓ ▓ █ █ Knolselder + ░ ░ ▓ ▓ █ █ ▓ ░ Groene boontjes █ █ █ █ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ Rode biet ▓ ▓ █ █ █ ▓ ▓ ▓ ▓ ▓ █ █ Sla +▓ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ Sjalot █ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ Waterkers ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ Champignon ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ Oesterzwam +▓ ▓ ░ ░ ░ ▓ █ Aardpeer ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Ajuin ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Friseline ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Lente-uitjes ░ ░ ▓ ▓ █ █ ▓ ▓ ▓ ▓ ▓ ▓ Radijsjes ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Tuinkers █ █ █ ▓ ░ ░ ░ ▓ █ █ Pastinaak +█ █ █ █ ▓ ▓ ▓ ▓ █ █ █ █ Prei ░ ░ ░ ░ ▓ █ ▓ ▓ █ ▓ ░ ░ Bloemkool ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Broccolini ▓ ▓ ▓ ░ ▓ ░ ░ ░ ▓ ▓ ▓ ▓ Chinese kool + ░ ▓ ▓ ▓ ▓ ░ Warmoes / snijbiet +█ █ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ █ █ Raap ░ ░ ▓ █ █ █ █ ▓ ░ Courgette +░ ░ ▓ ▓ █ █ █ █ █ █ ▓ ▓ Paksoi ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Boontjes ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Krulandijvie - ░ ▓ ▓ █ █ █ ▓ Augurk -█ █ ▓ ░ ▓ ▓ ▓ Boerenkool - ░ ▓ ▓ ▓ █ ▓ ░ ░ Broccoli -░ ░ ▓ ▓ ░ ░ ▓ ▓ ░ ░ Spitskool - ▓ ▓ ▓ ▓ ▓ ▓ Postelein - ▓ ▓ ▓ ▓ ▓ ▓ Radicchio Rosso - ▓ ▓ ▓ ▓ ▓ Artisjok -█ █ █ █ ▓ ▓ ▓ ▓ █ █ █ █ Prei -█ █ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ █ █ Raap -░ ░ ▓ ▓ █ █ █ █ █ █ ▓ ▓ Paksoi █ █ █ █ ░ ░ ░ ░ ▓ █ █ █ Rode kool █ █ █ ▓ ▓ ░ ░ ░ ▓ █ █ █ Witloof █ █ ▓ ▓ ░ ▓ ░ ░ █ █ █ █ Witte kool █ █ ▓ ░ ░ ░ ░ ▓ █ █ █ █ Savooikool ░ ░ ▓ ▓ █ █ █ █ █ █ ░ ░ Tomaat ░ ░ ░ ░ ▓ █ █ █ █ █ ▓ ▓ Peterselie + ░ ▓ ▓ █ █ █ ▓ Augurk ▓ ▓ ▓ ▓ ▓ ░ ░ ░ ▓ █ █ █ Shii-take ░ ░ ░ ▓ █ █ ▓ ▓ █ █ ▓ ░ Spinazie ░ ░ ░ ▓ █ █ █ █ █ ▓ ░ Wortelen +█ █ ▓ ░ ▓ ▓ ▓ Boerenkool ░ ░ ░ ▓ ▓ ▓ ░ ░ █ █ █ ▓ Pompoen ░ ░ ▓ █ █ █ █ █ ▓ ░ Selder + ░ ▓ ▓ ▓ █ ▓ ░ ░ Broccoli █ ▓ ▓ ░ ░ ░ ░ ░ █ █ █ Rammenas +░ ░ ▓ ▓ ░ ░ ▓ ▓ ░ ░ Spitskool █ █ ▓ ░ ░ ▓ █ █ █ Spruitjes ░ ▓ ▓ ▓ ▓ ▓ █ █ ▓ ░ Andijvie █ █ ▓ ░ ▓ █ █ █ Schorseneren ░ ▓ █ █ █ █ █ ░ Venkel + ▓ ▓ ▓ ▓ ▓ ▓ Postelein + ▓ ▓ ▓ ▓ ▓ ▓ Radicchio Rosso ░ ▓ ▓ ▓ █ █ █ ░ Koolrabi + ▓ ▓ ▓ ▓ ▓ Artisjok J F M A M J J A S O N D diff --git a/whats_hot.py b/whats_hot.py index f0924ba..6c37505 100755 --- a/whats_hot.py +++ b/whats_hot.py @@ -12,8 +12,8 @@ current_month_0 = date.today().month - 1 def score(item): name, months = item - # Sort by score of current month, then by how exclusive it is, then by name - return (months[current_month_0], -sum(months), name) + # Sort by relative prevalence in current month, then by name + return (months[current_month_0] / sum(months), name) def ranked_data(data):