The dataframe I'm using has a column named 'Sex' filled with 'male'/ 'female'.
I need to change 'male'/'female' for a number, namely 0 or 1.

I'm trying the following code

```
result =  df.apply(lambda x: 1 if x == 'male' else 0, )

```

and the error is

```
AttributeError: 'str' object has no attribute 'Sex'

```