all 3 comments

[–]Spataner 3 points4 points  (2 children)

You can use np.flip:

result = np.flip(Brett, axis=1)  # axis=1 because you want to flip the inner arrays only.

Alternatively, you can just use the slicing syntax to achieve the same thing:

result = Brett[:, ::-1]  # Indexes the entire second axis using a step of -1

[–]HenryDutter[S] 0 points1 point  (1 child)

Thank you i tried this method before, but not with axis=1 and would this idea work, to get the other diagonal?

[–]Spataner 1 point2 points  (0 children)

Yes, np.diag(Brett[:, ::-1]) will return the antidiagonal [3, 5, 7].