(vector, p=2)
return np.linalg.norm(vector, p)
Get p-norm of this vector
    Parameters
    ----------
    vector : numpy array, Input vector
    p: int, p-norm
Get p-norm of this vector
    Parameters
    ----------
    vector : numpy array, Input vector
    p: int, p-norm
Get p - norm of this vector Parameters ---------- vector : numpy array Input vector p : int p - norm
def norm(vector, p=2):
    """
    Get p-norm of this vector
    Parameters
    ----------
    vector : numpy array, Input vector
    p: int, p-norm
    """
    if p < 1:
        raise ValueError('p should larger or equal to 1 in p-norm')

    if type(vector).__name__ != 'ndarray':
        vector = np.array(vector)

    return np.linalg.norm(vector, p)
def norm ( vector , p = 2 ) : if p < 1 : raise ValueError ( 'p should larger or equal to 1 in p-norm' ) if type ( vector ) . __name__ != 'ndarray' : vector = np . array ( vector ) return np . linalg . norm ( vector , p )