Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how do you count most frequent item in a list in python

# most frequent value in a list
test = [1, 2, 3, 4, 2, 2, 3, 1, 4, 4, 4] 
print(max(set(test), key = test.count)) 
 
PREVIOUS NEXT
Tagged: #count #frequent #item #list #python
ADD COMMENT
Topic
Name
9+6 =