会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
cup_leo
博客园
首页
新随笔
联系
订阅
管理
2021年11月25日
python 求众数 含重复的众数
摘要: def mode(arr): dict_cnt = {} for x in arr: dict_cnt[x] = dict_cnt.get(x,0)+1 max_cnt = max(dict_cnt.values()) most_values = [k for k,v in dict_cnt.ite
阅读全文
posted @ 2021-11-25 11:37 cup_leo
阅读(532)
评论(0)
推荐(0)
公告