text_plain_output_1.png image_output_1.png
import pandas as pd

train_df = pd.read_csv('../input/train.csv')
test_df = pd.read_csv('../input/test.csv')

print(train_df[['FamilySize', 'Survived']].groupby(['FamilySize'], as_index=False).mean())
print(train_df[['isAlone', 'Survived']].groupby(['isAlone'], as_index=False).mean())