I have a dictionary of this genre:
{walt: 0.942342, disney: 0.324234, robert: 0.562354, help: 0.546912, ...}
And I do this to find the mean and the maximum:
media = statistics.mean(dicContadores.values())
counter = collections.Counter(dicContadores.keys())
maximo = counter.most_common(1)
minimo = min(dicContadores.items(), key=lambda x: x[1])
print(" Média: ", media)
print(" Máximo: ", maximo)
print(" Minimo: ", minimo)
The way I have this output:
Média: 0.0714285
Máximo: [('walt', 1)]
Minimo: ('disney', 0.324234)
But I have 1 problem: How do I make sure that the maximum associated value is not rounded?