I have a text file with 670,000 + lines need to process. Each line has the format of:
uid, a, b, c, d, x, y, x1, y1, t, 0,
I did some cleanning and transferred each line to a list:
[uid,(x,y,t)]
And my question is: How can I merge (x,y,t)tuples in different lists but have the common uid efficiently?
For example: I have multiple lists
[uid1,(x1,y1,t1)]
[uid1,(x2,y2,t2)]
[uid2,(x3,y3,t3)]
[uid3,(x4,y4,t4)]
[uid2,(x5,y5,t5)]
......
And I want to transfer them into:
[uid1,(x1,y1,t1), (x2,y2,z2)]
[uid2,(x3,y3,t3), (x5,52,z5)]
[uid3,(x4,y4,t4)]
......
Any help would be really appreciated.