Sep-05-2021, 09:14 PM
(This post was last modified: Sep-05-2021, 09:14 PM by Gribouillis.)
SamHobbs Wrote:Storing the data from the duplicates is the tricky part.Oh I see what you mean. It does not seem that tricky, you could replace the
unique_rows()
function above with this onedef unique_rows(rows): for key, group in itt.groupby(rows, key=itemgetter(0)): yield (key,) + tuple(itt.chain.from_iterable(r[1:] for r in group))