Python public recipes
Get the occurrences of all elements in a list
>>> from collections import Counter
>>> z = ['blue', 'red', 'blue', 'yellow', 'blue', 'red']
>>> Counter(z)
Counter({'blue': 3, 'red': 2, 'yellow': 1})
from collections import Counter
result = Counter(original_list)