How do I vectorize this calculation in numpy

Viewed 67

How do I vectorize the following calculation if a and b are appropriately sized numpy arrays?

total = a[0]
for ix in range(1, len(a)):
   total = total*b[ix-1] + a[ix]
1 Answers
Related