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

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

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

train = train[train['Embarked'].notna()]
train = train[train['Fare'] < 300]

train_clean = train.dropna(thresh=train.shape[1] - 1)
print(str(train.shape[0] - train_clean.shape[0]) + ' rows deleted in train')
train = train_clean