python import collections code example
Example 1: python counter
>>> Counter('abracadabra').most_common(3)
[('a', 5), ('r', 2), ('b', 2)]
Example 2: python collections
list = [1,2,3,4,1,2,6,7,3,8,1]
Counter(list)
>>> Counter('abracadabra').most_common(3)
[('a', 5), ('r', 2), ('b', 2)]
list = [1,2,3,4,1,2,6,7,3,8,1]
Counter(list)