Created
April 15, 2019 17:40
-
-
Save DiogoRibeiro7/958c851d6b4b61a8c477ee1f14001b96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def preprocess_titanic_df(df): | |
processed_df = df.copy() | |
le = preprocessing.LabelEncoder() | |
processed_df.sex = le.fit_transform(processed_df.sex) | |
processed_df.embarked = le.fit_transform(processed_df.embarked) | |
processed_df = processed_df.drop(['name','ticket','home.dest'],axis=1) | |
return processed_df | |
processed_df = preprocess_titanic_df(titanic_df) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment