How to group numerical sequences?

0

Friends, I have a csv file with 5k lines which lists shopping transactions. There is an id for each purchase, it happens that for a lot where several purchase transactions are performed there is an id that always starts with the same numerical sequence, but before the end of that sequence there is a number that identifies a purchase within a lot. Example:

Person purchased 5 items:

000034200100 000034200200 000034200300 000034200400 000034200500

If these sequences lived in this order would be marvel, it happens that these sequences are scattered in this file of 5k lines.

How can I bundle these bundles so that they are all in the same order as in my example? I want to do this in python ok.

I thought of clusters but I do not know if it's a good idea.

    
asked by anonymous 10.06.2017 / 00:24

0 answers