【Python】计算list中各个元素出现的频率

#方法一web from collections import Counter list = [59, 138, 13, 1367, 158, 35, 572, 43, 10, 34, 572, 572, 44, 12, 1345, 7, 21, 59, 10] list.sort() counter = Counter(list) print(counter) output:svg Coun
相关文章
相关标签/搜索