- 博客(1)
- 收藏
- 关注
原创 使用Python numpy 找数组中最大值及次大值、第三大值等最值
使用Python numpy 找数组中最大值及次大值、第三大值…下面就贴上代码def find_max(a): b = np.zeros(4) c = np.zeros(4) c[0] = np.max(a) #最大值 b[0] = np.where(a==c[0])[0] #最大``值位置 new_a = np.delete(a,b[0]) c[1] = np.max(new_a) #次大值 b[1] = np.where(
2020-06-20 10:44:53 16529
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人