netrd/utilities/threshold.py
def threshold_on_quantile(mat, quantile=0.9):
    """
    Threshold a numpy array by setting values below a given quantile to zero.

    Params
    ------
    mat: (np.ndarray): A numpy array.
    quantile (float): The threshold above which to keep an element of the array,
    e.g., set to zero elements below the 90th quantile of the array.

    Returns
    -------
    thresholded_mat: the thresholded numpy array

    """

    return mat * (mat > np.percentile(mat, quantile * 100))

    Threshold a numpy array by setting values below a given quantile to zero.

    Params
    ------
    mat: (np.ndarray): A numpy array.
    quantile (float): The threshold above which to keep an element of the array,
    e.g., set to zero elements below the 90th quantile of the array.

    Returns
    -------
    thresholded_mat: the thresholded numpy array

    
Threshold a numpy array by setting values below a given quantile to zero.
Params



Returns

the thresholded numpy array
Threshold a numpy array by setting values below a given quantile to zero . Params Returns the thresholded numpy array
def threshold_on_quantile(mat, quantile=0.9):
    return mat * (mat > np.percentile(mat, quantile * 100))
def threshold_on_quantile ( mat , quantile = 0.9 ) : return mat * ( mat > np . percentile ( mat , quantile * 100 ) )
Threshold a numpy array by setting values below a given quantile to zero.
Threshold a numpy array by setting values below a given quantile to zero .
"""
    Threshold a numpy array by setting values below a given quantile to zero.

    Params
    ------
    mat: (np.ndarray): A numpy array.
    quantile (float): The threshold above which to keep an element of the array,
    e.g., set to zero elements below the 90th quantile of the array.

    Returns
    -------
    thresholded_mat: the thresholded numpy array

    """
mat
quantile