text_plain_output_1.png image_output_1.png
import matplotlib.pyplot as plt

import missingno as msno

import pandas as pd

import seaborn as sns

df_train = pd.read_csv('../input/train.csv')
df_test = pd.read_csv('../input/test.csv')

df_train.isnull().sum()

msno.matrix(df=df_train.iloc[:, :], figsize=(7, 5), color=(0.5, 0.1, 0.2))

f,ax=plt.subplots(1,2,figsize=(16,6))
df_train['Survived'].value_counts().plot.pie(explode=[0,0.1],autopct='%1.1f%%',ax=ax[0],shadow=False)
ax[0].set_title('Survived')
ax[0].set_ylabel('')
sns.countplot('Survived',data=df_train,ax=ax[1])
ax[1].set_title('Survived')
plt.show()

df_train.groupby(['Sex', 'Survived'])['Survived'].count()

f, ax = plt.subplots(1, 2, figsize=(14, 4))
df_train[['Sex', 'Survived']].groupby(['Sex']).mean().plot.bar(ax=ax[0])
ax[0].set_title('Survived vs Sex')
sns.countplot('Sex', hue='Survived', data=df_train, ax=ax[1])
ax[1].set_title('Sex:Survived vs Dead')
plt.show()