I wonder how to create new columns in Pandas dataframe with flags if the element in a list existing in another column? updated: The list will be updated frequently and can be very dynamic and long. Is there any way to create flags based on a dynamic list? Thank you.
Thank you so much.
list =['apple', 'banana', 'peach']
Input dataframe:
Output dataframe: