Replacing column values in a pandas DataFrame
I’m trying to replace the values in one column of a dataframe. The column (‘female’) only contains the values ‘female’ and ‘male’. I have tried the following: w[‘female’][‘female’]=’1′ w[‘female’][‘male’]=’0′ But receive the exact same copy of the previous results. I would ideally like to get some output which resembles the following loop element-wise. if w[‘female’] … Read more