def q(s):
n = len(s)
v = numpy.zeros(n, dtype=float)
s is a vector containing however many elements I wish ([s0,s1,s2,....,sn-2,sn-1]) , and I intend to then create an array (initial full of zeros) that is of the same size as s.
My aim is to then to change the zero elements in this array to [s1/s0 , s2/s1 , s3/s2..., sn-1/sn-2].
I understand that a for loop is required, but I am finding it difficult to program this. Could anybody offer a hand? Thank you.