text_plain_output_1.png
import pandas as pd

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

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

train_data.shape

train_data.isnull().sum()

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

train_data.isnull().sum()

train_data.Age.fillna(value=train_data.Age.mean(), inplace=True)

train_data.isnull().sum()

train_data.Embarked.unique()

train_data.loc[train_data.Embarked == 'S'].count()

train_data.loc[train_data.Embarked == 'S']