Can't find a question/ answer that fits this exact criteria but if this is a duplicate question then I will delete it. Is there a numpy equivalent to the following code or is it better to just keep my code as is/ use xrange?
x = [i for i in range (50)]
y = [i for i in range (120)]
for i in x:
foo = [i+z for z in y]
print(foo)
This is a toy example but the the data set I am working with can range from something like this to 1000x the size in the example; I have tried np.idter
but don't see much of a performance increase and as I gathered from bmu's answer here using range to iterate over a numpy array is the worst. But I cannot see how ufunc and indexing can reproduce the same results as above which is my desired result.