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 =
Counting the frequency of elements is probably best done with a dictionary:
b = {} for item in a: b[item] = b.get(item, 0) + 1
To remove the duplicates, use a set:
a = list(set(a))