Python in Counter output statistics specific measures

 
from collections import Counter

# List 
l_one = [1709020621, 1709020621, 1770603107, 1770603105, 1770603106, 1770603105, 1709020621 ]
 # put the list into dictionary Statistical 
c = Counter (l_one)
 Print (c)
K = c.most_common (len (C))   # find all elements and the number of descending frequency corresponding elements. 
# Converted into a list, a list of each item is Ganso. 
Print (K)
 # data output in the descending order 
for I in K:
     Print (STR (I [0]) + "  " + STR (I [. 1]))

Guess you like

Origin www.cnblogs.com/ltb6w/p/10927107.html