0
I have a dictionary like that:
{walt: 0.942342, disney: 0.324234, robert: 0.562354, help: 0.546912, ...}
And I do it to find the average 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 this one got this output:
Média: 0.0714285
Máximo: [('walt', 1)]
Minimo: ('disney', 0.324234)
But I have one problem: How do I make the associated value not to be rounded at most?
You edited and put [solved], it would not be interesting to share the solution?
– Sidon
The solution has already been put, when I put [solved]
– Walt057
@Walt057 Sopt uses the structure of questions and answers, separating very well what is each thing. The question is to ask, the answer to answer. If you have the solution to your problem, always post as reply. Read about Answer your own question. Also, it is unnecessary to add "[solved]" in the title. This is a limitation that other people’s forums have, but Sopt does not. Read about this How and why to accept an answer?
– Woss