I have an array a, which is twodimensional. A contains objects which also contain objects. I want to make sure that a[1,1] becomes a[n,n], a[2,1] becomes a[n-1,n], a[2,2] becomes a[n-1][n-1] etc. I wrote the following code to do this:
tempArray = copy(self.topArea)
for y in range(0,len(tempArray)):
for x in range(0,len(tempArray[y])):
self.topArea[y][x] = tempArray[len(tempArray)-1-y][len(tempArray[y])-1-x]
But this achieves litteraly nothing. Deepcopying also does not help: the array does not get inverted.
How can I invert it?
numpyarray, or are you using the wrong word for alist?inversing? At first, I answered showing how to take the transpose, but now I think that isn't what you want ...