I have a 4-D Numpy array of dimensions 96x96x3x1000 - these correspond to an image dataset that I have imported : 1000 images each of 96X96 pixels and RGB values for each pixel.
However, I need to iterate over flattened arrays for each image, ie. only a 2-D array [1000][96*96*3]. I managed to transform the given array by first doing
a.reshape(-1,a.size[3])
and then assigning each column to an image using a loop. I wanted to ask if there is a simpler/slicing method for interchanging the ordering of ndarrays ?
Thanks