Better algorithm: not always available → rank higher
This commit is contained in:
parent
dea50d6e69
commit
9873a319c4
2 changed files with 49 additions and 47 deletions
92
README
92
README
|
@ -1,82 +1,84 @@
|
|||
whats_hot.py is wat je wil.
|
||||
|
||||
Het toont wat deze maand hot is.
|
||||
|
||||
Voor oktober staat hieronder de output. Maar in de terminal staan de niet-huidige maanden grijs
|
||||
voor beter overzicht! Zeker doen.
|
||||
|
||||
Fruit
|
||||
J F M A M J J A S O N D
|
||||
░ ░ █ █ ░ Stekelbes
|
||||
▓ ▓ Cassisbes
|
||||
▓ ▓ Kers
|
||||
░ ░ █ █ ░ Stekelbes
|
||||
█ █ ▓ ░ Pruim
|
||||
▓ █ █ ▓ ░ ░ Rode bes
|
||||
█ █ ▓ ░ Pruim
|
||||
░ ░ ▓ █ █ █ █ █ █ ▓ ▓ ░ Aardbei
|
||||
░ ▓ █ █ ▓ ▓ ▓ Blauwe bes
|
||||
░ ▓ █ █ █ ▓ ▓ ▓ ░ Braambes
|
||||
░ ▓ █ █ █ ▓ ▓ ░ Framboos
|
||||
░ █ ▓ Kiwibes
|
||||
░ ▓ █ █ ▓ ▓ ▓ Blauwe bes
|
||||
▓ ▓ ▓ ▓ Kweepeer
|
||||
░ █ ▓ Kiwibes
|
||||
▓ ▓ ▓ Veenbes
|
||||
█ █ █ █ █ █ ▓ ▓ █ █ █ █ Appel
|
||||
█ █ █ ▓ ▓ ▓ ░ ░ █ █ █ █ Peer
|
||||
|
||||
Groenten
|
||||
J F M A M J J A S O N D
|
||||
▓ █ ▓ ░ Asperge (groen)
|
||||
░ ▓ ▓ █ ▓ ░ Asperge (wit)
|
||||
▓ █ ▓ ░ Asperge (groen)
|
||||
░ █ ▓ ░ Erwtjes
|
||||
▓ ▓ ░ ░ ░ ▓ █ Aardpeer
|
||||
░ ░ ▓ █ █ █ ▓ ▓ ░ ░ Aubergine
|
||||
░ ░ ▓ ▓ █ █ ▓ ░ Groene boontjes
|
||||
░ ░ ▓ █ █ █ █ █ ▓ ░ ░ ░ Komkommer
|
||||
░ ░ ▓ █ █ █ ▓ ▓ ░ ░ Aubergine
|
||||
░ ▓ ▓ █ █ █ ▓ ░ Paprika
|
||||
░ ░ ▓ █ █ █ ▓ ░ ░ Rabarber
|
||||
▓ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ Sjalot
|
||||
░ ▓ ▓ ▓ ▓ ░ Warmoes / snijbiet
|
||||
█ █ █ ▓ ░ ▓ █ Zoete aardappel
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Ajuin
|
||||
▓ ▓ ▓ ▓ ▓ Artisjok
|
||||
░ ▓ ▓ █ █ █ ▓ Augurk
|
||||
░ ░ ░ ░ ▓ █ ▓ ▓ █ ▓ ░ ░ Bloemkool
|
||||
█ █ ▓ ░ ▓ ▓ ▓ Boerenkool
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Boontjes
|
||||
░ ▓ ▓ ▓ █ ▓ ░ ░ Broccoli
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Broccolini
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ Champignon
|
||||
▓ ▓ ▓ ░ ▓ ░ ░ ░ ▓ ▓ ▓ ▓ Chinese kool
|
||||
░ ░ ▓ █ █ █ █ ▓ ░ Courgette
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Friseline
|
||||
░ ░ ▓ ▓ █ █ ▓ ░ Groene boontjes
|
||||
▓ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ▓ Sjalot
|
||||
▓ ▓ ░ ░ ░ ▓ █ Aardpeer
|
||||
░ ▓ ▓ ▓ ▓ ░ Warmoes / snijbiet
|
||||
█ █ █ █ █ █ ▓ ░ ▓ ▓ █ █ Knolselder
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Krulandijvie
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Lente-uitjes
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ Oesterzwam
|
||||
█ █ █ ▓ ░ ░ ░ ▓ █ █ Pastinaak
|
||||
▓ ▓ ▓ ▓ ▓ ▓ Postelein
|
||||
▓ ▓ ▓ ▓ ▓ ▓ Radicchio Rosso
|
||||
░ ░ ▓ ▓ █ █ ▓ ▓ ▓ ▓ ▓ ▓ Radijsjes
|
||||
█ █ █ █ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ Rode biet
|
||||
▓ ▓ █ █ █ ▓ ▓ ▓ ▓ ▓ █ █ Sla
|
||||
░ ░ ▓ ▓ ░ ░ ▓ ▓ ░ ░ Spitskool
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Tuinkers
|
||||
█ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ Waterkers
|
||||
░ ▓ ▓ ▓ ▓ ▓ █ █ ▓ ░ Andijvie
|
||||
░ ▓ ▓ ▓ █ █ █ ░ Koolrabi
|
||||
░ ░ ▓ ▓ █ █ █ █ █ █ ▓ ▓ Paksoi
|
||||
░ ░ ░ ░ ▓ █ █ █ █ █ ▓ ▓ Peterselie
|
||||
░ ░ ░ ▓ ▓ ▓ ░ ░ █ █ █ ▓ Pompoen
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ Champignon
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ Oesterzwam
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Ajuin
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Friseline
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Lente-uitjes
|
||||
░ ░ ▓ ▓ █ █ ▓ ▓ ▓ ▓ ▓ ▓ Radijsjes
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Tuinkers
|
||||
█ █ █ ▓ ░ ░ ░ ▓ █ █ Pastinaak
|
||||
░ ░ ░ ░ ▓ █ ▓ ▓ █ ▓ ░ ░ Bloemkool
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Broccolini
|
||||
▓ ▓ ▓ ░ ▓ ░ ░ ░ ▓ ▓ ▓ ▓ Chinese kool
|
||||
░ ░ ▓ █ █ █ █ ▓ ░ Courgette
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Boontjes
|
||||
▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ ▓ Krulandijvie
|
||||
░ ▓ ▓ █ █ █ ▓ Augurk
|
||||
█ █ ▓ ░ ▓ ▓ ▓ Boerenkool
|
||||
░ ▓ ▓ ▓ █ ▓ ░ ░ Broccoli
|
||||
░ ░ ▓ ▓ ░ ░ ▓ ▓ ░ ░ Spitskool
|
||||
▓ ▓ ▓ ▓ ▓ ▓ Postelein
|
||||
▓ ▓ ▓ ▓ ▓ ▓ Radicchio Rosso
|
||||
▓ ▓ ▓ ▓ ▓ Artisjok
|
||||
█ █ █ █ ▓ ▓ ▓ ▓ █ █ █ █ Prei
|
||||
█ █ ▓ ▓ ▓ ▓ ▓ ▓ ▓ █ █ █ Raap
|
||||
█ ▓ ▓ ░ ░ ░ ░ ░ █ █ █ Rammenas
|
||||
░ ░ ▓ ▓ █ █ █ █ █ █ ▓ ▓ Paksoi
|
||||
█ █ █ █ ░ ░ ░ ░ ▓ █ █ █ Rode kool
|
||||
█ █ ▓ ░ ░ ░ ░ ▓ █ █ █ █ Savooikool
|
||||
█ █ ▓ ░ ▓ █ █ █ Schorseneren
|
||||
░ ░ ▓ █ █ █ █ █ ▓ ░ Selder
|
||||
▓ ▓ ▓ ▓ ▓ ░ ░ ░ ▓ █ █ █ Shii-take
|
||||
░ ░ ░ ▓ █ █ ▓ ▓ █ █ ▓ ░ Spinazie
|
||||
█ █ ▓ ░ ░ ▓ █ █ █ Spruitjes
|
||||
░ ░ ▓ ▓ █ █ █ █ █ █ ░ ░ Tomaat
|
||||
░ ▓ █ █ █ █ █ ░ Venkel
|
||||
█ █ █ ▓ ▓ ░ ░ ░ ▓ █ █ █ Witloof
|
||||
█ █ ▓ ▓ ░ ▓ ░ ░ █ █ █ █ Witte kool
|
||||
█ █ ▓ ░ ░ ░ ░ ▓ █ █ █ █ Savooikool
|
||||
░ ░ ▓ ▓ █ █ █ █ █ █ ░ ░ Tomaat
|
||||
░ ░ ░ ░ ▓ █ █ █ █ █ ▓ ▓ Peterselie
|
||||
▓ ▓ ▓ ▓ ▓ ░ ░ ░ ▓ █ █ █ Shii-take
|
||||
░ ░ ░ ▓ █ █ ▓ ▓ █ █ ▓ ░ Spinazie
|
||||
░ ░ ░ ▓ █ █ █ █ █ ▓ ░ Wortelen
|
||||
░ ░ ░ ▓ ▓ ▓ ░ ░ █ █ █ ▓ Pompoen
|
||||
░ ░ ▓ █ █ █ █ █ ▓ ░ Selder
|
||||
█ ▓ ▓ ░ ░ ░ ░ ░ █ █ █ Rammenas
|
||||
█ █ ▓ ░ ░ ▓ █ █ █ Spruitjes
|
||||
░ ▓ ▓ ▓ ▓ ▓ █ █ ▓ ░ Andijvie
|
||||
█ █ ▓ ░ ▓ █ █ █ Schorseneren
|
||||
░ ▓ █ █ █ █ █ ░ Venkel
|
||||
░ ▓ ▓ ▓ █ █ █ ░ Koolrabi
|
||||
J F M A M J J A S O N D
|
||||
|
|
|
@ -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 name
|
||||
return (months[current_month_0], name)
|
||||
# Sort by score of current month, then by how exclusive it is, then by name
|
||||
return (months[current_month_0], -sum(months), name)
|
||||
|
||||
|
||||
def ranked_data(data):
|
||||
|
|
Loading…
Reference in a new issue