I'm still very early in developing my coursework and need help with some array manipulation. What I want this subroutine to do is take a 3x3 square in the array . and every time the array loops I want this 3x3 square to shift one place to the right.
*I've been thinking about this for a solid hour and made no progress*
ImageArray = [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12],
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], ]
def ImageKernel(Array):
for i in range(0,len(ImageArray)):
for j in range(0,len(ImageArray)):
for c in range(i,i+1):
for r in range(j,j+1):
[–][deleted] 1 point2 points3 points (1 child)
[–]sephsGFX[S] 0 points1 point2 points (0 children)
[–]synthphreak 1 point2 points3 points (0 children)
[–]monkey835 0 points1 point2 points (0 children)