quick and very basic newbie question.
If i have list of dictionaries looking like this:
L = [] L.append({\"value1\": value1, \"value2\": value2, \"value3
Here's one way:
keyfunc = lambda d: (d['value3'], d['value4']) from itertools import groupby giter = groupby(sorted(L, key=keyfunc), keyfunc) L2 = [g[1].next() for g in giter] print L2