@grouping
def number_of_contacts(records, direction=None, more=0):

    if direction is None:
        counter = Counter(r.correspondent_id for r in records)
    else:
        counter = Counter(r.correspondent_id for r in records if r.direction == direction)

    return sum(1 for d in counter.values() if d > more)
The number of contacts the user interacted with.
dataset/ETHPy150Open yvesalexandre/bandicoot/bandicoot/individual.py/number_of_contacts