I have a data in a format as shown below which can be genarated using the Python code given below
df = pd.DataFrame({'Person_id':[1,2,3,4],
'Values':['father:1.Yes 2.No 3.Do not Know','Mother:1.Yes 2.No 3.Do not
Know','sons:1.Yes 2.No 3.Do not Know','daughter:1.Yes 2.No 3.Do not Know'],
'Ethnicity':['dffather','dfmother','dfson','dfdaughter']})
What I would like to do is split the 'Values' cell content into 3 separate rows/ n seperate rows based on the number of values available in the cell. In this case, we have 3 options (1.Yes, 2.No and 3. Do not Know). I don't wish to retain the text like father, mother, son etc. I only wish to have the options
How can I get my output to be like as shown below
Please note that the options and values might differ in real time. What I have shown is a sample and there is no pattern that exists in terms of answer options.