0

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

Luis Henrique
  • 701
  • 15
  • 36

1 Answers1

0
>>> from collections import Counter
>>> CUSTOMER = ['MARIA', 'JOAO', 'MARIA', 'JOAO']
>>> Counter(CUSTOMER)
Counter({'MARIA': 2, 'JOAO': 2})
Chris
  • 15,819
  • 3
  • 24
  • 37