I want to change a 2d array
a = [[1,2,3]
[3,4,5]
[6,7,8]
[9,10,11]]
into
b= [[9,10,11]
[6,7,8]
[3,4,5]
[1,2,3]]
using numpy package
This looks like task for numpy.flip, that is:
import numpy as np
a = np.array([[1,2,3],[3,4,5],[6,7,8],[9,10,11]])
b = np.flip(a,0)
print(b)
Output:
[[ 9 10 11]
[ 6 7 8]
[ 3 4 5]
[ 1 2 3]]
numpy.flipud?a[::-1, :]?