I'm trying to figure out how to order in numpy this kind of situation:
First I created image blocks with two for loops (just for example):
cuts = 9 # This is for example, there could be much more blocks
for row in range(cuts):
for column in range(cuts):
block_min_x = (1 / cuts) * row
block_max_x = (1 / cuts) * (row + 1)
block_min_y = (1 / cuts) * column
block_max_y = (1 / cuts) * (column + 1)
Then I add those "image blocks" to array with names like "img_1_1, img_1_2, img_1_3, img_2_1, img_2_2, img_2_3..." in that order. So it looks like this in array (example with numbers):
[6,7,8] [15,16,17] [24,25,26]
[3,4,5] [12,13,14] [21,22,23]
[0,1,2] [9,10,11] [18,19,20]
Is there somekind of method to order those blocks to like this with numpy:
[0,1,2] [3,4,5] [6,7,8]
[9,10,11] [12,13,14] [15,16,17]
[18,19,20] [21,22,23] [24,25,26]
And here is image to show it better what I'm looking for:
I'm not sure if there is somekind of term for this kind of problem, so apologize cannot use right tems. Problem seems to be like we need to "rotate clockwise" that ordering as you see in that blue line in example image. So the question is, how to order that in numpy? Also if it could changed in those for loops would be nice to know.



rot90is what you should use since it's more readable, but it's worth realizing that you can do a rotation witha[::-1].T, ie "flip vertically then flip diagonally".