1

I have an array x=np.ones(1000) and would like to perform operations on this based on recurrence formulae:

    x[i]= f(x[i-1], x[i-2])

What is the fastest way to do it in a vectorize way ?

I know that xx= ne.evaluate(xx1*xx2) can only manage already filled array.

Fabricator
  • 12,722
  • 2
  • 27
  • 40

1 Answers1

0

I found a partial way, at least for some functions:

list[:,1:]= np.exp(hlist)  
list = np.cumprod(list, axis = 1)  

with f(x) = f(x-1)exp(ax)

I think generic cum would be useful