def entropy(labels):
    label_set = set(labels)
    
    # setup variables needed for statistics
    sums = {}
    count = 0.0
    for each in label_set:
        sums[each] = 0.0
        
    for each in labels:
        sums[each] += 1.0
        count += 1.0
        
    ent = 0.0
    for each in sums.values():
        p_i = count/each
        ent -= p_i * lg (p_i)
    return ent
dataset/ETHPy150Open bolme/pyvision/src/pyvision/vector/id3.py/entropy/swapped operands of `/`