This question already has an answer here:
As shown in the above pic, I've a column, genres, with a list of genres the corresponding movie belongs to. There are in total 19 unique genres. I'd like to know if I can manipulate this data into appending 19 columns to the data set each corresponding to each of the genres identifiers and label the corresponding cells as 0 or 1 indicating the movies affiliation to the each genre columns.
It should look something like below picture.
We can do this after splitting the 'genres' column
Or another option is to create a matrix with column names as 'genres' and then do a comparison on the splitted string