I want to stack n number of columns as new rows at the end of the array. I was trying to do it with reshape but I couldn't make it. For example given the table
table = np.array([[11,12,13,14,15,16],
[21,22,23,24,25,26],
[31,32,33,34,35,36],
[41,42,43,44,45,46]])
my output if n=2 should be:
array([[11, 12],
[21, 22],
[31, 32],
[41, 42],
[13, 14],
[23, 24],
[33, 34],
[43, 44],
[15, 16],
[25, 26],
[35, 36],
[45, 46]])
and if n=3:
array([[11, 12, 13],
[21, 22, 23],
[31, 32, 33],
[41, 42, 43],
[14, 15, 16],
[24, 25. 26],
[34, 35, 36],
[44, 45, 46]])
Update:
Ok,I managed to achieve the result that I want with the following command:
import numpy as np
n=2
np.concatenate(np.split(table, table.shape[1]/n, axis=1), axis=0)
n=3
np.concatenate(np.split(table, table.shape[1]/n, axis=1), axis=0)
I do not know though if it is possible to be done with reshape.

arr1can be reshaped intoarr2is to check ifarr1.flatten()is equal toarr2.flatten(). Clearly not in your case. So if you expect to use a singlereshape(...)method, you'll need to use additionally something else (it might be double usage ofreshape(..)in some scenarios)flatten()but apparently as you mention most likely it is not possible.np.transpose,np.squeeze,np.swapaxis. You'll check also a nice example ofmaxpoolingwhich is quite close to your problem. I'll try to adapt it to your problem.reshapebecause that was the first command that it came to my mind to use but as you say what I have is likely good enough.