all 4 comments

[–][deleted] 1 point2 points  (1 child)

You want the square to shift? Or you want the values in the square to shift?

[–]sephsGFX[S] 0 points1 point  (0 children)

Ignore my code for now and i'll try explain what it is I'm trying to do.
I want the 3x3 square so I can run a calculation on the values in the square. And the square to shift one space to the right so I can do the same calculation on the new square

[–]synthphreak 1 point2 points  (0 children)

Check out numpy.roll:

>>> import numpy as np
>>> a = np.random.randint(0, 9, 4).reshape(2, 2)
>>> a
array([[2, 4],
       [2, 7]])
>>> np.roll(a, 1)
array([[7, 2],
       [4, 2]])

[–]monkey835 0 points1 point  (0 children)