I have a 1 x 2 x 3 array:
>>> a = np.array([[[1,2,3],[4,5,6]]])
>>> a
array([[[1, 2, 3],
[4, 5, 6]]])
>>> a.shape
(1, 2, 3)
I want to reshape it to (3,1,2), but so that the elements along original dim 3 are now along dim 1. I want the result to look like this:
>>> new_a
array([[[1, 4]],
[[2, 5]],
[[3, 6]]])
and when I just use reshape, I get the the right shape, but the elements are in the same order, not what I want:
>>> a.reshape((3,1,2))
array([[[1, 2]],
[[3, 4]],
[[5, 6]]])
How can I achieve this?