lst = np.array([[[1,2,3,4],[4,5,6,7]],[[7,8,9,10],[11,12,13,14]],[[16,17,18,19],[20,21,22,23]]])
lst
array([[[ 1, 2, 3, 4],
[ 4, 5, 6, 7]],
[[ 7, 8, 9, 10],
[11, 12, 13, 14]],
[[16, 17, 18, 19],
[20, 21, 22, 23]]])
lst.sum(axis=0) #1+7+16 / 2+8+17....
array([[24, 27, 30, 33], #axis=0时 计算数组的最外层 三个二维数组依次相加
[35, 38, 41, 44]])
lst.sum(axis=1) #1+4 / 2+5 / 3+6
array([[ 5, 7, 9, 11], # 三维数组里的每一个二维数组内分别计算 分别相加
[18, 20, 22, 24],
[36, 38, 40, 42]])
lst.sum(axis=2) #1+2+3+4 / 4+5+6+7
array([[10, 22], #数组内部元素求和
[34, 50],
[70, 86]])