0

Is it possible in a pandas dataframe to expand the a column of comma seperate values to be dummy variables. This sounds confusing but the example below should bring to life

Input dataframe

Column_A
Red, Blue
Blue
Green, Blue

Expected output

Column_A       Red      Blue    Green
Red, Blue       1         1       0
Blue            0         1       0
Green, Blue     0         1       1    
fred.schwartz
  • 2,023
  • 4
  • 26
  • 53

0 Answers0