cumsum() and cumprod() (NumPy)
np.cumsum() returns the running (cumulative) sum of an array — each element is the total of all elements up to that point.
np.cumsum() returns the running (cumulative) sum of an array — each element is the total of all elements up to that point.