Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

value count a list python

from collections import Counter
z = ['blue', 'red', 'blue', 'yellow', 'blue', 'red']
Counter(z)
>>> Counter({'blue': 3, 'red': 2, 'yellow': 1})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #count #list #python
ADD COMMENT
Topic
Name
3+8 =