Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

collections counter sort by value

>>> Counter('abracadabra').most_common(3)
[('a', 5), ('r', 2), ('b', 2)]
Source by pythonworld.ru #
 
PREVIOUS NEXT
Tagged: #collections #counter #sort
ADD COMMENT
Topic
Name
1+6 =