Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python counter least common

from collections import Counter
data_list = [1,1,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4]
least_common = Counter(data_list).most_common()[-1]
print(least_common)
# The number 1 appears 2 times
(1, 2)
Source by www.delftstack.com #
 
PREVIOUS NEXT
Tagged: #python #counter #common
ADD COMMENT
Topic
Name
4+8 =