【发布时间】:2019-11-16 20:39:07
【问题描述】:
即使这部分代码是正确的,我也有这组代码给我一个IndexError,但我不知道为什么,但我肯定错过了一些东西。
mr = np.array([[0.3,0.2,0.4]])
permutation=np.argsort(mr)[::-1]
permutation
p0=mr[permutation]
p0
回溯说我在p0=mr[permutation] 中有错误,它给了我这个错误消息:IndexError: index 1 is out of bounds for axis 0 with size 1
【问题讨论】:
-
你的预期输出是什么?
-
我希望从这段代码中没有数组中的最大值或最小值我希望数组按降序排列
-
欺骗链接有很多答案。请检查。
-
谢谢这是我正在寻找的成功答案
标签: python