(x)
return x.sum()
Calculate information-theoretic entropy measure for a given
    distribution.

    Parameters
    ----------
    x : ndarray
        Input distribution.

    Returns
    -------
    res : float
        Entropy measure result.
Calculate information-theoretic entropy measure for a given
    distribution.
Calculate information - theoretic entropy measure for a given distribution .
def entropy(x):
    """
    Calculate information-theoretic entropy measure for a given
    distribution.

    Parameters
    ----------
    x : ndarray
        Input distribution.

    Returns
    -------
    res : float
        Entropy measure result.
    """
    x = x[x != 0]
    x /= x.sum()
    x *= -np.log2(x)
    return x.sum()
def entropy ( x ) : x = x [ x != 0 ] x /= x . sum ( ) x *= - np . log2 ( x ) return x . sum ( )