Here is a function I found that shifts an image by "x" in the x dir, and "y" in the y dir:
def translate(img, x,y): # x and y = # pixe