0

I am trying to make a feature variable from the Titanic dataset on kaggle by pulling specific information from two variables but I can't figure out how to code it. I want to combine the "Sex" variable and the "Parch" variable. What I want is if the passenger is a female with children or parents they should be coded as 1 in a new variable called "WomenandChildren." If they are a woman without children/parents or a male with or without children they should be coded as a 0.

My theory is that women with children were more likely to survive then women without children or men with or without children.

cchamberlain
  • 17,444
  • 7
  • 59
  • 72
Darrin Thomas
  • 159
  • 1
  • 10

1 Answers1

1

By using panda or scikit learning python libraries, and by using python language, you can combine feature variables.