text_html_output_1.png
import pandas as pd

import seaborn as sns

data_train = pd.read_csv('D:\\projects ML\\titanic\\train.csv')

data_train.shape

data_train.isnull().sum()

data_train = data_train.drop(columns='Cabin', axis=1)

data_train.isnull().sum()

data_train.replace({'Sex': {'male': 0, 'female': 1}, 'Embarked': {'S': 0, 'C': 1, 'Q': 2}}, inplace=True)

data_train.drop('Embarked', axis=1, inplace=True)
data_train

X = data_train.drop(columns=['PassengerId', 'Name', 'Ticket', 'Survived', 'Fare'], axis=1)
X.head()