C
C. Ng
Is there a numpy operation that does the following to the array?
1 2 ==> 4 3
3 4 2 1
Thanks in advance.
1 2 ==> 4 3
3 4 2 1
Thanks in advance.
C. Ng said:Is there a numpy operation that does the following to the array?
1 2 ==> 4 3
3 4 2 1
array([[4, 3],a[::-1].transpose()[::-1].transpose()
array([[4, 3],a.reshape((4,))[::-1].reshape((2,2))
array([[1, 2],Is there a numpy operation that does the following to the array?
1 2 ==> 4 3
3 4 2 1
Thanks in advance.import numpy as np
a=np.array([[1,2],[3,4]])
a
Is there a numpy operation that does the following to the array?
1 2 ==> 4 3
3 4 2 1
Thanks in advance.
How about:
array([[4, 3], [2, 1]])import numpy as np
a = np.array([[1,2],[3,4]])
a array([[1, 2], [3, 4]])
a[::-1, ::-1]
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.