def order(matrix, psuedotime):
    """Order the rows of a matrix by rank of psuedotime.
    
    Arguments:
        matrix (pandas DataFrame): samples x features (rows x cols) matrix
        psuedotime (pandas Series): Ordererable values indexed by the same row names of matrix.

    Returns:
       (pandas DataFrame): ordered samples x features (rows x cols) matrix
    """
    return(matrix.loc[psuedotime.sort_values().index])