[Numpy-discussion] Applying formula to all in an array which has value from previous

Vishal Rana ranavishal@gmail....
Sun Mar 28 14:19:42 CDT 2010


Hi,

For a numpy array:

array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])

I do some calculation with 0, 1... and get a value = 2.5, now use this value
to do the repeat the same calculation with next element for example...
2.5, 2 and get a value = 3.1
3.1, 3 and get a value = 4.2
4.2, 4 and get a value = 5.1
....
....     and get a value = 8.5
8.5, 9 and get a value = 9.8

So I should be getting a new array like array([0, 2.5, 3.1, 4.2, 5.1, .....
8.5,9.8])

Is it where numpy or scipy can help?

Thanks
Vishal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100328/a11b2448/attachment.html 


More information about the NumPy-Discussion mailing list