for entry in l:
    if summary[entry[0]]:
        summary[entry[0]] += entry[1:]
else:
    summary[entry[0]] = entry[1:]
for s in summary:
    summary[s] = [int(x) for x in list(set(summary[s]))]
Similarity of lists in Python - comparing customers according to their features