There are several issues with your example (some of which may be actual problems, others just typos or over simplifiactions):
import numpy as np # if you want to use for-loops don't use numpy
rays = np.array(... # closing parentheses instead of brackets
# unequal dimensions row of 5 and row of 6
for i in range(rays): # rays is not a number, did you mean len(rays[0])?
for w in range(i): # w is not used anywhere
estimate = rays[0][i]/(rays[0][i]+rays[1][i])
# estimate is overwritten at each iteration
The whole point of using numpy is to avoid "manually" iterating through array elements using for-loops. You should think of your result as an operation between matrices (or vectors):
For example (without for-loops):
import numpy as np
rays = np.array([[7.651e-03, 7.284e-03, 5.134e-03, 7.442e-03, 3.035e-03],
[2.373e-03, 6.877e-03, 4.809e-03, 2.870e-04, 3.175e-04]])
estimates = rays[0]/(rays[0]+rays[1])
print(estimates)
[0.76326816 0.51437045 0.51634316 0.96286712 0.90529456]
Note that I removed the last value from the second row because numpy requires fixed dimensions (i.e. it cannot have one row with 5 elements and another with 6)
Your nested loop for w in range(i), though you're not doing anything with w, suggests that you may be looking for the ratio between cumulative sums. If that is the case, use the cumsum function from numpy:
estimates = np.cumsum(rays[0])/np.cumsum(rays[0]+rays[1])
print(estimates)
[0.76326816 0.61753153 0.58805087 0.65726163 0.67565445]
raysdefinition looks syntactically incorrect -- it's got a mismatched)in the first sublist. This also isn't a numpy array, it's a list of lists.estimateresulting in the ratio of the last value. You might as well have writtenestimate = rays[0][-1]/(rays[0][-1]+rays[1][-1])without any for loop.