How to create multiple flag columns based on list values found in the dataframe column?
问题 The table looks like this : ID |CITY ---------------------------------- 1 |London|Paris|Tokyo 2 |Tokyo|Barcelona|Mumbai|London 3 |Vienna|Paris|Seattle The city column contains around 1000+ values which are | delimited I want to create a flag column to indicate if a person visited only the city of interest. city_of_interest=['Paris','Seattle','Tokyo'] There are 20 such values in the list. Ouput should look like this : ID |Paris | Seattle | Tokyo ------------------------------------------- 1 |1