I would like to create a new column with a numerical value based on the following conditions:
a. if gender is male & pet1=pet2, points = 5
b. if gender is female & (pet1 is 'cat' or pet1='dog'), points = 5
c. all other combinations, points = 0
gender pet1 pet2
0 male dog dog
1 male cat cat
2 male dog cat
3 female cat squirrel
4 female dog dog
5 female squirrel cat
6 squirrel dog cat
I would like the end result to be as follows:
gender pet1 pet2 points
0 male dog dog 5
1 male cat cat 5
2 male dog cat 0
3 female cat squirrel 5
4 female dog dog 5
5 female squirrel cat 0
6 squirrel dog cat 0
How do I accomplish this?