I have the following array:
CUSTOMER = ['MARIA', 'JOAO', 'MARIA', 'JOAO']
I would like to do the following count:
{'MARIA': 2, 'JOAO': 2}
I tried using the from collections import Counter
library, but counted each letter in the array
I have the following array:
CUSTOMER = ['MARIA', 'JOAO', 'MARIA', 'JOAO']
I would like to do the following count:
{'MARIA': 2, 'JOAO': 2}
I tried using the from collections import Counter
library, but counted each letter in the array
>>> from collections import Counter
>>> CUSTOMER = ['MARIA', 'JOAO', 'MARIA', 'JOAO']
>>> Counter(CUSTOMER)
Counter({'MARIA': 2, 'JOAO': 2})