text_html_output_1.png
import pandas as pd

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

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

df['Age'] = df['Age'].fillna(df['Age'].median())

df.dtypes

l = df['Embarked']
l_num = []
for i in l:
    if i == 'S':
        l_num.append(1)
    elif i == 'C':
        l_num.append(2)
    else:
        l_num.append(3)
df['Embarked'] = l_num
df['Embarked'].head()