numpy返回array中元素的index

import numpy

a = numpy.array(([3,2,1],[2,5,7],[4,7,8]))

itemindex = numpy.argwhere(a == 7)

print (itemindex)

print a

你可能感兴趣的:(numpy返回array中元素的index)