I want to convert data of 'edjefe' column which contains int as well as 'yes' and 'no' values. My problem is I just want to map 'yes' and 'no' to 1 and 0 and keep the int values as it is So I wrote this code
def foo(x):
if x == 'no':
return 0
elif x == 'yes':
return 1
else:
return x
and df1.edjefe.map(lambda x : foo(x))
But I am getting an error as,
RecursionError: maximum recursion depth exceeded while calling a Python object