I have a dataframe where one column contains an ID, and the other column contains a series of words with numbers associated with them. As and example:
ColA ColB
A Banana:2;Kiwi:4;Apple:1
B Kiwi:1;Orange:4
I would like to duplicate each of the words in ColB by the number associated with it. So, the output I'm looking for would be:
ColA ColB
A Banana;Banana;Kiwi;Kiwi;Kiwi;Kiwi;Apple
B Kiwi;Orange;Orange;Orange;Orange
Any suggestions or solutions would be greatly appreciated! Thanks