This is my dataframe, column "Reference" can have more than one word (separated by space blank " ")
Col1 Col2 Col3 Reference
Apple Broccoli Frog M1139 M1944
Orange Tomato Rope M1134
Potato Tuna Lemon M1129 M1944 M2944
I would like to create a duplicate of the entire row if there is more than one word in column "Reference", writing each word in each line.
For example in row 1 there are 2 words in "Reference" M1139 M1944,therefore two lines are created:
Desired output:
Col1 Col2 Col3 Reference
Apple Broccoli Frog M1139
Apple Broccoli Frog M1944
Orange Tomato Rope M1134
Potato Tuna Lemon M1129
Potato Tuna Lemon M1944
Potato Tuna Lemon M2944