I have a pandas dataframe with many columns. One of them is a series. I want to split that column into a set of boolean columns. So, if the value in a row is ['Red','Hot','Summer'], I want 3 columns: Red (having value 1), Hot (having value 1) and Summer (having value 1).
Example:
df = pd.DataFrame({'Owner': ['Bob', 'Jane', 'Amy'],
'Make': ['Ford', 'Ford', 'Jeep'],
'Model': ['Bronco', 'Bronco', 'Wrangler'],
'Sentiment': [['Meh','Red','Dirty'], ['Rusty','Sturdy'], ['Dirty','Red']],
'Max Speed': [80, 150, 69],
'Customer Rating': [90, 50, 91]})
gives us:
Now I want this output:
(the True/False could be ones and zeros, too. Just as good).
note: I looked at this post below: Split a Pandas column of lists into multiple columns but that only directly works if your series isn't already part of a DF.
any help appreciated!