I need to find the frequency of elements in an unordered list
a = [1,1,1,1,2,2,2,2,3,3,4,5,5]
output->
b =
Another approach of doing this, albeit by using a heavier but powerful library - NLTK.
import nltk fdist = nltk.FreqDist(a) fdist.values() fdist.most_common()