def make_2d(a):
 a = np.atleast_2d(a.T).T
 n = a.shape[0]
 newshape = np.product(a.shape[1:]).astype(int)
 a = a.reshape((n, newshape), order='F')
 return a

def make_2d ( a ) : a = np . atleast_2d ( a . T ) . T n = a . shape [ 0 ] newshape = np . product ( a . shape [ 1 : ] ) . astype ( int ) a = a . reshape ( ( n , newshape ) , order = 'F' ) return a
ravel the dimensions after the first .