def entropy(data):
    entropy = 0.0

    if len(data) == 0:
        return entropy

    for x in range(256):
        p_x = float(data.count(chr(x)))/len(data)
        if p_x > 0:
            entropy += - p_x*math.log(p_x, 2)
    return entropy
dataset/ETHPy150Open androguard/androguard/elsim/elsim/similarity/similarity.py/entropy/original