0

I have a Dataframe that has lots stored in each column. I am trying to have them unpacked such that each combination is made into a new row. Given below is how my data looks like.

cust_id,prod_name,type,value
101,['car','bike','computer'],['t1','t2','t3'],['434','533','55']
102,['car','bike'],['t1','t3'],['533','55']

Trying to convert the above dataframe to the below format:

cust_id,prod_name,type,value
101,car,t1,434
101,bike,t2,533
101,computer,t3,55
102,car,t1,533
102,bike,t3,55
scott martin
  • 1,253
  • 1
  • 14
  • 36

1 Answers1

0

There is a great answer for this question here: https://stackoverflow.com/a/53218939/6348485

I would mark this question as a duplicate but I don't think I have enough reputation to do it.

The above is a great answer offering almost 10 different methods.

Swagga Ting
  • 602
  • 3
  • 17