慕标5832272
假设我们有这个向量:>import numpy as np>arr = np.arange(30).reshape(6,5)>arrarray([[ 0, 1, 2, 3, 4], [ 5, 6, 7, 8, 9], [10, 11, 12, 13, 14], [15, 16, 17, 18, 19], [20, 21, 22, 23, 24], [25, 26, 27, 28, 29]])这样,您将获得特定行的所有值的总和:>np.sum(arr[1,:]) #On row 135对于您的具体情况,请使用:>np.sum(arr[13,:])