例题2.30

例题2.30代码

import numpy as np
a = np.array([[0, 3, 4], [1, 6, 4]])
b = a.sum()
c1 = sum(a)
c2 = np.sum(a, axis = 0)
c3 = np.sum(a, axis = 1, keepdims = True)
#print(c1)
print(c2.shape, c3.shape)


posted @ 2024-10-22 21:58  等我刷把宗师  阅读(23)  评论(0)    收藏  举报