Say that I have a color image, and naturally this will be represented by a 3-dimensional array in python, say of shape (n x m x 3) and call it img.
I want a new 2-d
Let's say we have an array img of size m x n x 3 to transform into an array new_img of size 3 x (m*n)
img
m x n x 3
new_img
3 x (m*n)
new_img = img.reshape((img.shape[0]*img.shape[1]), img.shape[2]) new_img = new_img.transpose()