Parameter (parameter):
pass in an optional parameter n (the number of the most representative for the first n elements, if not pass parameters, return all the representative result)
return (return):
returns a list (which is a tuple element, tuple bit 0 is counted concrete elements, the first bit tuple is the number of occurrences, such as: [( 'a', 1 ), [( 'b'), 2], [( 'c', 3)]]) when the count value of the plurality of the same elements, listed in alphabetical order.
Original link: https: //blog.csdn.net/qq_43608884/article/details/90243678
most_common Counter class () function
Guess you like
Origin www.cnblogs.com/liuxiangyan/p/12500414.html
Recommended
Ranking