I am looking at the famous Titanic dataset from the Kaggle competition found here: http://www.kaggle.com/c/titanic-gettingStarted/data
I have loaded and processed the da
Here is my solution:
# convert string column to category df.Sex = df.Sex.astype('category') # create additional column for its codes df['Sex_code'] = df_clean.Sex.cat.codes