python get array of occurrences of value in list code example
Example 1: how to find the number of times a number appears in python
dict((i, a.count(i)) for i in a)
Example 2: count occurrences of value in array python
>>> l = ["a","b","b"]
>>> l.count("a")