text_plain_output_1.png image_output_1.png
import pandas as pd

data = pd.read_csv('/kaggle/input/titanicdataset-traincsv/train.csv')
data

data.count()

a = data.filter(['AgeBin', 'Survived'])
b = a.pivot_table(index='AgeBin', columns=['Survived'], aggfunc=len)
b

data[data['Sex'] == 'male']['Survived'].value_counts().plot(kind='bar', xlabel='Male Survivor', title='Number of Male Survivors and Death')