def _get_norms_of_rows(data_frame, method):
    """ return a column vector containing the norm of each row """
    if method == 'vector':
        norm_vector = np.linalg.norm(data_frame.values, axis=1)
    elif method == 'last':
        norm_vector = data_frame.iloc[:, -1].values
    elif method == 'mean':
        norm_vector = np.mean(data_frame.values, axis=1)
    elif method == 'first':
        norm_vector = data_frame.iloc[:, 0].values
    else:
        raise ValueError("no normalization method '{0}'".format(method))
    return norm_vector
def _get_norms_of_rows ( data_frame , method ) : if method == 'vector' : norm_vector = np . linalg . norm ( data_frame . values , axis = 1 ) elif method == 'last' : norm_vector = data_frame . iloc [ : , - 1 ] . values elif method == 'mean' : norm_vector = np . mean ( data_frame . values , axis = 1 ) elif method == 'first' : norm_vector = data_frame . iloc [ : , 0 ] . values else : raise ValueError ( "no normalization method '{0}'" . format ( method ) ) return norm_vector
return a column vector containing the norm of each row