📅  最后修改于: 2022-03-11 14:45:08.164000             🧑  作者: Mango
import numpy as np
a = np.matrix([[1,2,3,33],[4,5,6,66],[7,8,9,99]])
print(np.argmax(a)) # 11, which is the position of 99
print(np.argmax(a[:,:])) # 11, which is the position of 99
print(np.argmax(a[:1])) # 3, which is the position of 33
print(np.argmax(a[:,2])) # 2, which is the position of 9
print(np.argmax(a[1:,2])) # 1, which is the position of 9