import collections python use code example
Example 1: python counting dictionary
counts = dict()
for i in items:
counts[i] = counts.get(i, 0) + 1
Example 2: python collections
list = [1,2,3,4,1,2,6,7,3,8,1]
Counter(list)
counts = dict()
for i in items:
counts[i] = counts.get(i, 0) + 1
list = [1,2,3,4,1,2,6,7,3,8,1]
Counter(list)