This is snipett of my code with column values comparison:
import pandas as pd
df =pd.DataFrame({'coname1':['Apple','Yahoo','Gap Inc'],'coname2':['Apple', 'Google', 'Apple']})
df['eq'] =df.apply(lambda row: row['coname1'] == row['coname2'],axis=1)
The problem is that I am interested with Character (True='Y' or False = 'N') or Integer (True= 1 or False = 0) values.
Option df.replace(['True', 'False'],[1,0]) doesn't work
Thank you

replaceon the df:df.replace({'True':1,'False':0})df['eq'] = df.apply(lambda row: 1 if row['coname1'] == row['coname2'] else 0, axis=1)