I have a dataframe which contains two columns of user feedback.
The first column is from a multi-choice answer of the survey. In each row of the column is a list of the answers they selected.
the next column is a category of age range. so one row will contain a list of the users colour preferences and an age range.
e.g.
what colours do you like? age
['yellow','orange','green'] 18-25
['yellow'] 18-25
['blue','green','red','orange'] 26-30
['blue','red'] 26-30
I'm looking to get individual counts for each colour in the list and then split by age range desired output:
age colour count
18-25 yellow 2
18-25 orange 1
18-25 green 1
26-30 blue 2
26-30 green 1
26-30 red 2
26-30 orange 1
thanks in advance!