获取前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 阅读(16) 评论(0) 推荐(0)
posted @ 2024-01-15 16:41 MonsterPPPP 阅读(16) 评论(0) 推荐(0)
posted @ 2023-11-10 10:38 MonsterPPPP 阅读(20) 评论(0) 推荐(0)
posted @ 2023-11-10 10:36 MonsterPPPP 阅读(17) 评论(0) 推荐(0)
posted @ 2023-11-10 10:28 MonsterPPPP 阅读(48) 评论(0) 推荐(0)
posted @ 2023-10-08 16:40 MonsterPPPP 阅读(43) 评论(0) 推荐(0)
posted @ 2023-09-28 17:47 MonsterPPPP 阅读(168) 评论(0) 推荐(0)
posted @ 2023-09-27 11:38 MonsterPPPP 阅读(64) 评论(0) 推荐(0)
posted @ 2022-11-03 11:51 MonsterPPPP 阅读(41) 评论(0) 推荐(0)