Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

count items in list

>>> from collections import Counter
>>> mylist = ["Bob", "Mike", "Bob", "Mike", "Mike", "Mike", "Bob"]
>>> Counter(mylist)
Counter({'Mike': 4, 'Bob': 3})
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #count #items #list
ADD COMMENT
Topic
Name
3+4 =