(X)
return np.asmatrix(mat)
Creates a row-matrix from multi-dimensional data items in list l.
    
    X [list] List with multi-dimensional data.
Creates a row-matrix from multi-dimensional data items in list l.
    
    X [list] List with multi-dimensional data.
Creates a row - matrix from multi - dimensional data items in list l . X [ list ] List with multi - dimensional data .
def asRowMatrix(X):
    """
    Creates a row-matrix from multi-dimensional data items in list l.
    
    X [list] List with multi-dimensional data.
    """
    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([0, total], dtype=X[0].dtype)
    for row in X:
        mat = np.append(mat, row.reshape(1,-1), axis=0) # same as vstack
    return np.asmatrix(mat)
def asRowMatrix ( 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 ( [ 0 , total ] , dtype = X [ 0 ] . dtype ) for row in X : mat = np . append ( mat , row . reshape ( 1 , - 1 ) , axis = 0 ) # same as vstack return np . asmatrix ( mat )