I'm looking to get an array (or matrix) that is circular, such that
Let:
a = [1,2,3]
Then I would like
a[0] = 1
a[1] = 2
a[2] = 3
a[3] = 1
a[4] = 2
Etc for all index values of a.
The reason is because I have an image as a matrix and what I'm trying to process it with the behaviour that if it goes off the edge in one direction, it should reappear on the opposite side.
Any tips on how to do this cleanly would be much appreciated!
itertoolsiterations