累乘
a = np.array([1, 2, 3, 4]) b = np.prod(a) # 24 c = np.cumprod(a) # [ 1, 2, 6, 24]
累加
a = np.array([1, 2, 3, 4]) b = np.sum(a) # 10 c = np.cumsum(a) # [1, 3, 6, 10]