course22
course22 copied to clipboard
[Titanic] "Alone" feature should be true when there are no family members
Family members = number of siblings/spouses + number of parents/childen
Family members == 0 ==> Alone is true
Currently it is set as
df['Alone'] = df.Family==1
My change makes it:
df['Alone'] = df.Family!=1
Check out this pull request on
See visual diffs & provide feedback on Jupyter Notebooks.
Powered by ReviewNB
Shouldn't the code then be:
df['Alone'] > 0
instead of
df['Alone'] = df.Family!=1
For the latter one, if the number of family members is say 2, then your code would return True, which is not what we want