Sum by rows and by columns: >>> >>> x = np.array([[1, 1], [2, 2]]). >>> x. array([[1, 1],. [2, 2]]). >>> x.sum(axis=0) # columns (first dimension).
確定! 回上一頁