text_plain_output_1.png
import missingno as msno

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

train = pd.read_csv('/kaggle/input/titanic/train.csv')

train.shape

train.duplicated().sum()

women = train.loc[train.Sex == 'female']['Survived']
women_sur_rate = sum(women) / len(women)
men = train.loc[train.Sex == 'male']['Survived']
men_sur_rate = sum(men) / len(men)

import missingno as msno
msno.matrix(train)

train.drop(['PassengerId', 'Ticket', 'Cabin', 'Name'], axis=1, inplace=True)
msno.matrix(train)

train.Age.fillna(train.Age.mean(), inplace=True)
msno.matrix(train)

train.dropna(inplace=True)
msno.matrix(train)