I did not need a library to solve this, but I have to say that previous responses are very elegant, this a raw alternative if you are not that knowledgeable in python libraries:
1 - lets say that you have the following array:
a = ['a','b','c','d','a','b','c','d','a']
2 - then I recommend to sort it:
a.sort()
out[]: [a,a,a,b,b,c,c,d,d]
3 - once you have the array sorted you only need to identify when it changes from one letter to another, as is shown in the following code:
a = ['a','b','c','d','a','b','c','d','a']
a.sort()
counter = 0
for i in range(len(a)):
counter += 1
try:
if(a[i] != a[i+1]):
print(a[i] + ' is ' + str(counter) + ' times' )
counter = 0
except:
print(a[i] + ' is ' + str(counter) + ' times' )
I use try-except to handle the end of the array, anyway the code is built in a simple way without applying any library, as I mention before previous responses are very elegant and have better performance, but maybe this will help you to improve your understanding on how to build an algorithm. Best wishes keep coding :)