In my dataset there is a column that contains yes-no values, so I want to change them into 1-yes and 0-no using lambda function.
Code:
df['columnname'] = df['columnname'].apply(lambda a:1 if a == 'Yes' else 0)
The problem is all of data in my dataset turns into 0. Where is the error?