I have a data frame that has various columns, one of them being sex which has 3 different value types:
- male
- female
- NaN
and the other is employment types:
- employed
- unemployed
How do I create a function that takes in two strings (representing the the column names of interest) e.g function(sex, employment) and say I want to assign values in the data frame whose sex column value is Male = 1, Female = 2, NaN/other = 5 f and for employment, employed = 10, unemployed = 5 - Then make the function return the total of the two values above?
e.g function('Male', 'employed')
output = 11