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.

4

1 回答 1

1

通过使用panda或者scikit学习python库,使用python语言,可以组合特征变量。

于 2016-03-08T14:53:19.257 回答