(probs)
calc entropy
        :param:probs:probality array:float array
        :return:entropy:float
calc entropy
        :param:probs:probality array:float array
        :return:entropy:float
calc entropy : param : probs : probality array : float array : return : entropy : float
def entropy(probs):
    """calc entropy
        :param:probs:probality array:float array
        :return:entropy:float
    """
    exceptions2.judge_null(probs)
    if isinstance(probs, (list, tuple)):
        return sum([-prob * log(prob, 2) for prob in probs])
    elif isinstance(probs, (int, float)):
        return -probs * log(probs, 2)
def entropy ( probs ) : exceptions2 . judge_null ( probs ) if isinstance ( probs , ( list , tuple ) ) : return sum ( [ - prob * log ( prob , 2 ) for prob in probs ] ) elif isinstance ( probs , ( int , float ) ) : return - probs * log ( probs , 2 )