0
Can anyone please tell me what does code does
Can anyone explain to me how this code works: df['male'] = df['Sex'] == 'male'
3 Answers
+ 3
Set the row value of male column is true, if the value of sex column is "male" for the given DataFrame, df.
Edit:
example,
Sex male
----------------
1 male True
2 female False
3 male True
0
Esch Perfect answer.