I have data with (x,y) coordinates that origins in the lefttop corner. I turn into a matrix with indexes starting from 0 that looks like that:
| 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|
for example (x,y)=(1,4) id = y*5 + x = 21. But i want it to origin in the left bottom so that i obtain a matrix with indexing like that:
| 20| 21| 22| 23| 24|
| 15| 16| 17| 18| 19|
| 10| 11| 12| 13| 14|
| 5 | 6 | 7 | 8 | 9|
| 0 | 1 | 2 | 3 | 4|
so basically reversing the rows. Is there a way to do that in pythonic way? What would be the most computationally efficient way to achieve it otherwise?