How to move axis on simple numpy array
I'm having trouble moving the 3 axis to the 1 position. I would like to move the 3 to the first 69 position. This is for a machine learning dataset and PyTorch will only accept the data if it's in a 3x69x69 format. Thanks for any help! 

 # To get the images and labels from file
with h5py.File(r"C:\Users\ajbur\Downloads\Galaxy10.h5", 'r') as F:
    images = np.array(F['images'])
    labels = np.array(F['ans'])
np.shape(images)
np.moveaxis(images,0,-1).shape
np.shape(images)


output is [20000, 69, 69, 3]
I want it to be [20000, 3, 69, 69]

The second and third arguments of moveaxis are source and destination. To move the last axis to the second position you could do:

a = np.empty([20000, 69, 69, 3])
np.moveaxis(a, -1, 1).shape
&gt;&gt;&gt; (20000, 3, 69, 69)

