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