I have the following dataframe:
import pandas as pd
import numpy as np
df = pd.DataFrame({
'Name': ['A','B','A','B','A','B','A','B'],
'Include':[np.nan,np.nan,np.nan,np.nan,np.nan,np.nan,np.nan,np.nan],
'Category':['Cat','Dog','Car','Dog','Bike','Dog','Cat','Bike'],
})
df
I am trying to fill the Include column with the string yes if the column Category does not match the following list:
exluded = ['Car','Bike']
So that my expected output is this:
Any ideas of how to achieve this? THanks!


