df['containName'] = 0
for i in range (df2.shape[0]):
df.loc[df['string'].str.contains(df2['name'][i],case=False), "containName"]=1
I am using the above code, but it takes a lot of time (my df contain millions of rows). Any vectorized fast solution?