axis 先看懂numpy.argmax的含义.那么numpy.sum就非常好理解. 看一维的例子. import numpy as np a = np.array([1, 5, 5, 2]) print(np.sum(a, axis=0)) 上面代码就是把各个值加相加.默认axis为0.axis在二维以上数组中才能体现出来作用. import numpy as np a = np.array([[1, 5, 5, 2], [9, 6, 2, 8], [3, 7, 9, 1]]) print(n…