I have a data frame sp with a column named Status. The values in the Status column are either 'Done' or 'Waiting'. I need to change the values of the Status column using a lambda function, where a status of 'Done' is changed to 'A' and a status of 'Waiting' is changed to 'N'. This is how I tried to do it:
sp['Status'] = sp['Status'].apply(lambda x: x='A' if x=='Done' else x='N')
I then get the following error message:
sp['Status'] = sp['Status'].apply(lambda x: x='A' if x=='Done' else x='N')
^
SyntaxError: invalid syntax
Where am I doing wrong?