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

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

df.shape

df.isnull().sum() * 100 / df.shape[0]

df1 = df.copy()

df1.drop('Cabin', axis=1, inplace=True)

df1.Embarked.isnull().sum()

df1 = df1.dropna(axis=0, subset=['Embarked'])

df1.shape

df1_pc2 = df1[df1['Pclass'] == 2]
df1_pc2.shape