0
    column1     column2
    MGI:97874   MP 0008796;MP 0009395;MP 0009937;MP 0011098;MP 0011703
    MGI:96522   MP 0001614;MP 0000364;MP 0006093
    MGI:83838   MP 4209998;MP 2838838;MP 8283904;MP 9384784

My question is how to expand the rows of the same value (in column 1) into multiple lines, so the output will be like that:

    MGI:97874   MP 0008796
    MGI:97874   MP 0009395
    MGI:97874   MP 0009937
    MGI:97874   MP 0011098
    MGI:97874   MP 0011703
    MGI:96522   MP 0001614
    MGI:96522   MP 0000364
    MGI:96522   MP 0006093
    MGI:83838   MP 4209998
    MGI:83838   MP 2838838
    MGI:83838   MP 8283904
    MGI:83838   MP 9384784

Someone shared this with me: Unnest (explode) a Pandas Series

but it's a bit different and it's split mine into letters which I don't want!

LamaMo
  • 576
  • 2
  • 8
  • 19

0 Answers0