Issue
I'm trying to reshape an array of bitmap images that has a shape of (50,50,90000). How can I modify it so that I can get an array of (90000,50,50)? - I tried array.reshape(90000,50,50), or np.reshape(array, (90000,50,50), order='C' /'F'), but these options changed the order of the data so I couldn't get the images after using these.
Solution
Try np.moveaxis
, e.g. like so:
np.moveaxis(arr, 0, 2)
There's also np.swapaxes
if that suits your needs better.
Answered By - kwinkunks
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.