I have the following code where I used two for loops to iterate through and array and copy elements to another at an offset position, how could this be done without for loops for faster computation?
for i in range (data1.shape[0]):
for j in range (data1.shape[1]):
try:
translated[i+x_cord][j+y_cord]=data1[i][j]
except:
pass
Here, I'm just doing image translation.