def sign_array(p_values, alpha=0.05):
    """
    Significance array

    Converts an array with p values to a significance array where
    0 is False (not significant), 1 is True (significant),
    and -1 is for diagonal elements.

    Parameters
    ----------
    p_values : array_like or ndarray
        An array, any object exposing the array interface, containing
        p values.

    alpha : float, optional
        Significance level. Default is 0.05.

    Returns
    -------
    Numpy array where 0 is False (not significant), 1 is True (significant),
    and -1 is for diagonal elements.

    Examples
    --------

    >>> p_values = np.array([[ 0.        ,  0.00119517,  0.00278329],
                             [ 0.00119517,  0.        ,  0.18672227],
                             [ 0.00278329,  0.18672227,  0.        ]])
    >>> ph.sign_array(p_values)
    array([[-1,  1,  1],
           [ 1, -1,  0],
           [ 1,  0, -1]])

    """

    p_values = np.array(p_values)
    p_values[p_values > alpha] = 0
    p_values[(p_values < alpha) & (p_values > 0)] = 1
    np.fill_diagonal(p_values, -1)
    return p_values
def sign_array ( p_values , alpha = 0.05 ) : p_values = np . array ( p_values ) p_values [ p_values > alpha ] = 0 p_values [ ( p_values < alpha ) & ( p_values > 0 ) ] = 1 np . fill_diagonal ( p_values , - 1 ) return p_values
Significance array

    Converts an array with p values to a significance array where
    0 is False (not significant), 1 is True (significant),
    and -1 is for diagonal elements.

    Parameters
    ----------
    p_values : array_like or ndarray
        An array, any object exposing the array interface, containing
        p values.

    alpha : float, optional
        Significance level. Default is 0.05.

    Returns
    -------
    Numpy array where 0 is False (not significant), 1 is True (significant),
    and -1 is for diagonal elements.

    Examples
    --------

    >>> p_values = np.array([[ 0.        ,  0.00119517,  0.00278329],
                             [ 0.00119517,  0.        ,  0.18672227],
                             [ 0.00278329,  0.18672227,  0.        ]])
    >>> ph.sign_array(p_values)
    array([[-1,  1,  1],
           [ 1, -1,  0],
           [ 1,  0, -1]])