@grouping
def percent_pareto_interactions(records, percentage=0.8):

    records = list(records)
    if records == []:
        return 0.

    user_count = Counter(r.correspondent_id for r in records)

    target = int(math.ceil(sum(user_count.values()) * percentage))
    user_sort = sorted(user_count.keys(), key=lambda x: user_count[x])

    while target > 0 and len(user_sort) > 0:
        user_id = user_sort.pop()
        target -= user_count[user_id]

    return (len(user_count) - len(user_sort)) / len(records)
Set printer settings
dataset/ETHPy150Open yvesalexandre/bandicoot/bandicoot/individual.py/percent_pareto_interactions--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/openpyxl-2.3.0-b2/openpyxl/worksheet/worksheet.py/Worksheet.set_printer_settings