如何经过numpy得到二维或多维数组的最大、小值索引

虽然numpy数组中有argmax的函数能够得到数组的最大值的索引,但该函数得到的是numpy数组平铺后的索引,也就是一维索引。那么要怎样才能得到二维索引呢?实现很简单,好比我下面的代码:html import numpy as np import math a = np.array([[1, 2, 3], [4, 5, 6]]) m, n = a.shape inde
相关文章
相关标签/搜索