def entropy(data):

    if len(data) == 0:
        return None

    n = sum(data)

    _op = lambda f: f * math.log(f)
    return - sum(_op(float(i) / n) for i in data)
Compute the Shannon entropy, a measure of uncertainty.
dataset/ETHPy150Open yvesalexandre/bandicoot/bandicoot/helper/tools.py/entropy