<filename>test.py
import pandas

titanic = pandas.read_csv("train.csv")
titanic["Age"] = titanic["Age"].fillna(titanic["Age"].median())


titanic.loc[titanic["Sex"] == "male", "Sex"] = 0
titanic.loc[titanic["Sex"] == "female", "Sex"] = 1

titanic["Embarked"] = titanic["Embarked"].fillna("S")


titanic.loc[titanic["Embarked"] == "S", "Embarked"] = 0
titanic.loc[titanic["Embarked"] == "C", "Embarked"] = 1
titanic.loc[titanic["Embarked"] == "Q", "Embarked"] = 2


print(titanic["Embarked"].unique())
<filename>test.py
import pandas

titanic = pandas.read_csv("train.csv")
titanic["Age"] = titanic["Age"].fillna(titanic["Age"].median())


titanic.loc[titanic["Sex"] == "male", "Sex"] = 0
titanic.loc[titanic["Sex"] == "female", "Sex"] = 1

titanic["Embarked"] = titanic["Embarked"].fillna("S")


titanic.loc[titanic["Embarked"] == "S", "Embarked"] = 0
titanic.loc[titanic["Embarked"] == "C", "Embarked"] = 1
titanic.loc[titanic["Embarked"] == "Q", "Embarked"] = 2


print(titanic["Embarked"].unique())