Right now I have a 2x2 ND-array, namely np.array([[93, 95], [84, 100], [99, 87]])
. I would like to reverse the second column of the array into, such that I get: np.array([[93, 87], [84, 100], [99, 95]])
.
I tried the following code:
grades = np.array([[93, 95], [84, 100], [99, 87]])
print(grades[::-1,:])
However, the result I get is
[[ 99 87]
[ 84 100]
[ 93 95]]
I understand that this is because I am reversing all of the entries in the 1-axis, which is why the entries in the first column is also reversed. So what code can I write to get:
[[ 93 87]
[ 84 100]
[ 99 95]]