PyDocs

Nav

Data Types

Counter.most_common

  • Counter.most_common(n=None)
List the n most common elements and their counts from the most
common to the least.  If n is None, then list all element counts.

>>> Counter('abracadabra').most_common(3)
[('a', 5), ('b', 2), ('r', 2)]
1 Example
>>> Counter('abracadabra').most_common(3)
[('a', 5), ('b', 2), ('r', 2)]
from the Python docs
See Also
No see-alsos for collections/Counter.most_common
0 Notes
No notes for Counter.most_common