I have two data frames l3 which contains 559 rows and the other day frame 'mains' contains 58 rows and now I want to create a column 'new' in l3 such that if the value in l3 column 'dum' is present in any of the rows of the column 'Datecomb' in mains dataframe then the new column should contain True else False
I Tried :
def f(i):
if((i == (mains['Datecomb']).any()) == True):
return 'True'
else:
return 'False'
l3['new']=l3['dum'].apply(f)
But this function returned only "False" I used value counts for both l3['dum'] and mnains['Datecomb'] and i could see common values using Ctrl+F option on chrome...