获取前N大与前N小的list索引
摘要:
import numpy as np arr = np.array(class_org) #前15大 maxt = arr.argsort()[-15:][::-1] #前15小 mint = arr.argsort()[:15] argsort会从小到大返回索引值。 阅读全文
posted @ 2024-01-15 16:41 MonsterPPPP 阅读(27) 评论(0) 推荐(0)
posted @ 2024-01-15 16:41 MonsterPPPP 阅读(27) 评论(0) 推荐(0)
posted @ 2023-11-10 10:38 MonsterPPPP 阅读(37) 评论(0) 推荐(0)
posted @ 2023-11-10 10:36 MonsterPPPP 阅读(35) 评论(0) 推荐(0)
posted @ 2023-11-10 10:28 MonsterPPPP 阅读(76) 评论(0) 推荐(0)
posted @ 2023-10-08 16:40 MonsterPPPP 阅读(68) 评论(0) 推荐(0)
posted @ 2023-09-28 17:47 MonsterPPPP 阅读(221) 评论(0) 推荐(0)
posted @ 2023-09-27 11:38 MonsterPPPP 阅读(100) 评论(0) 推荐(0)
posted @ 2022-11-03 11:51 MonsterPPPP 阅读(69) 评论(0) 推荐(0)