I have a data frame which looks like the below:
Customer 1 Customer 2 Customer 3
A B C
B C D
C D E
D E F
E F G
There are customers coming to a store continuously. I want to create a row of the first 3 customers coming in the store in an hour. As the customers keep coming in continuously, it keeps taking group 3 and making rows. Though I do not want to form strict hour lining like 1-2, 2-3, etc.
I just want if customer B and C are covered in row 1, they should not be counted in row 2. I want to delete rows that have overlapping items and only keep the unique ones. So my expected output would be:
Customer 1 Customer 2 Customer 3
A B C
D E F
G
How to achieve this, please help. Thanks