arr = [1,2,3,4,5,6,4,5,2,3,6,8,9,6,5,3,6,2,4]
dic={}
for item in arr:
if item in dic.keys():
dic[item]+=1
else:
dic[item]=1
dic= sorted(dic.items(), key=lambda d:d[1], reverse = True)
相关文章:
- python统计英文文本中的回文单词数 2020-05-13
- 词频分析 2019-10-19
- 用R爬虫+词频统计+数据可视化 - 阿蛮的杜鹃 2021-08-03
- 洛谷 P1026 统计单词个数 2020-07-17
- 个人作业8 单词统计 2021-09-04
- Java 多线程读取文件并统计词频 实例 出神入化的《ThreadPoolExecutor》 2021-01-18
- 字符串操作、文件操作,英文词频统计预处理 - 浅锘晗 2021-08-13
- R语言进行词云统计分析 2018-12-19