Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> a = np.array([[[1,2,3],[4,5,6]]])
- >>> a
- array([[[1, 2, 3],
- [4, 5, 6]]])
- >>> a.shape
- (1, 2, 3)
- >>> new_a
- array([[[1, 4]],
- [[2, 5]],
- [[3, 6]]])
- >>> a.reshape((3,1,2))
- array([[[1, 2]],
- [[3, 4]],
- [[5, 6]]])
- a.transpose(2,0,1)
- In [347]: a
- Out[347]:
- array([[[1, 2, 3],
- [4, 5, 6]]])
- In [348]: a.transpose(2,0,1)
- Out[348]:
- array([[[1, 4]],
- [[2, 5]],
- [[3, 6]]])
- np.moveaxis(a,2,0)
- np.rollaxis(a,2,0)
- array.transpose(2,0,1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement