I have 5 set (at max) of values:
ID1 ID2 ID3 ID4 ID5
1 2 3 5 7
1 2
1 8
3 9
4 11 15
4 17
11 15
17 4 18
IF IDs are on the same row then they belong to a common group:
SO, I want to generate the groups:
In this example, I will have two groups:
1,2,3,5,7,8,9
and
4,11,15,17,18
I can do it for each column using
v1 = df['ID1'].tolist()
v1= "','".join(map(str,v1)
But I cannot separate the group and cannot do it for rows. Any clue please?