Converting pandas column of comma-separated strings into dummy variables
问题 In my dataframe, I have a categorical variable that I'd like to convert into dummy variables. This column however has multiple values separated by commas: 0 'a' 1 'a,b,c' 2 'a,b,d' 3 'd' 4 'c,d' Ultimately, I'd want to have binary columns for each possible discrete value; in other words, final column count equals number of unique values in the original column. I imagine I'd have to use split() to get each separate value but not sure what to do afterwards. Any hint much appreciated! Edit: