Calculate running totals and products with np.cumsum() and np.cumprod().
Cumulative functions compute running totals where each element in the output array is the progressive accumulation of all preceding elements up to that position.
Cumulative sum is like watching your savings bank account balance grow after each monthly paycheck deposit.
`np.cumsum([a, b, c])` outputs `[a, a+b, a+b+c]`. `np.cumprod([a, b, c])` outputs `[a, a*b, a*b*c]`.
running_sum = np.cumsum(arr)res = arr.cumsum # Missing parenthesesres = arr.cumsum()cumsum is a function that must be called with parentheses `()`, optionally passing `axis`.
Solve the objective below using NumPy vectorized syntax
Create `arr = np.array([1, 2, 3, 4])`, compute its cumulative sum using `np.cumsum(arr)`, and print.
[ 1 3 6 10]