Here is the sample code.
import pandas as pd, numpy as np
df = pd.DataFrame(np.random.randint(0,100,size=(10, 1)), columns=list('A'))
I have a list dl=[0,2,3,4,7]
At the index positions specified by list, I would like to have column A as "Yes".
The following code works
df.loc[dl,'A']='Yes'
How do I fill column 'A' with 'No' for column values not in index. Please forgive me if this is a duplicate post.