@grouping
def entropy_of_contacts(records, normalize=False):
    counter = Counter(r.correspondent_id for r in records)

    raw_entropy = entropy(counter.values())
    n = len(counter)
    if normalize and n > 1:
        return raw_entropy / math.log(n)
    else:
        return raw_entropy
The entropy of the user's contacts.
dataset/ETHPy150Open yvesalexandre/bandicoot/bandicoot/individual.py/entropy_of_contacts