I want to remove the for loops in the following Python code by vectorizing it. I searched the Stack overflow and all over the internet to find a solution to no avail.
for v in range(height):
for u in range(width):
start[v,u,0] = -0.5 + u / (width-1)
start[v,u,1] = (-0.5 + v / (height-1)) * height / width
start[v,u,2] = 0
I think we should use NumPy. Perhaps numpy.linspace() is to be used? So, what do you think?