pandas - split string and take each couple

Viewed 83

I have a dataframe that looks like that:

         IDs
  Name
  John   1,4,8
  Eric   2,9,17
  Paul   41,72,78,100

I need to take every combination from the IDs and to assign it to a new raw, so the output df should look like that:

        IDs
Name   
John    1,4
John    1,8
John    4,8
Eric    2,9
Eric    2,17
Eric    9,17
Paul    41,72
Paul    41,78
Paul    41,100
Paul    72,78
Paul    72,100
Paul    78,100

I tried several ways but none of them even start to look close to what I need.

1 Answers
Related