def asColumnMatrix(X):
 if (len(X) == 0):
  return np.array([])
 total = 1
 for i in range(0, np.ndim(X[0])):
  total = (total * X[0].shape[i])
 mat = np.empty([total, 0], dtype=X[0].dtype)
 for col in X:
  mat = np.append(mat, col.reshape((-1), 1), axis=1)
 return np.asmatrix(mat)

def asColumnMatrix ( X ) : if ( len ( X ) == 0 ) : return np . array ( [ ] ) total = 1 for i in range ( 0 , np . ndim ( X [ 0 ] ) ) : total = ( total * X [ 0 ] . shape [ i ] ) mat = np . empty ( [ total , 0 ] , dtype = X [ 0 ] . dtype ) for col in X : mat = np . append ( mat , col . reshape ( ( - 1 ) , 1 ) , axis = 1 ) return np . asmatrix ( mat )
creates a column-matrix from multi-dimensional data items in list l .