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

path = '../input/'
df_train = pd.read_csv(f'{path}train.csv', index_col='PassengerId')
df_test = pd.read_csv(f'{path}test.csv', index_col='PassengerId')
target = df_train['Survived']
target.columns = ['Survived']
df_train = df_train.drop(labels='Survived', axis=1)

df_train['Training_set'] = True
df_test['Training_set'] = False
df_full = pd.concat([df_train, df_test])
df_full = df_full.drop(labels=['Ticket', 'Name', 'Cabin'], axis=1)
df_full
"count_nosurname = 0\nfor i,(name) in enumerate(df_full['Name']):\n    name = name.strip()\n    ind = name.find(',')\n    indw = name.find(' ')\n    if(ind!=-1):\n         df_full.at[i,'Name'] = name[0:ind]\n    else:\n        count_nosurname += 1\n        df_full.at[i,'Name'] = name[0:indw]\nprint(count_nosurname)\ndf_full.drop(index = 0, axis = 0)        "

df_full.isnull().sum()[df_full.isnull().sum() > 0]