Created
January 8, 2019 03:34
-
-
Save finnqiao/d24b65d63b624dd212b15ec5e946979e 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
# Separating with continuous and categorical variables. | |
X_cont = ['age', 'campaign', 'pdays', 'previous', 'emp.var.rate', 'cons.price.idx', 'euribor3m', 'nr.employed'] | |
X_cat = ['job', 'marital', 'education', 'default', 'housing', 'loan', 'contact', 'month', 'day_of_week', 'poutcome'] | |
cont_df = X_df[X_cont] | |
cat_df = X_df[X_cat] | |
# Creating dummy variable dataframe from categorical variables. | |
X_df = cont_df.join(pd.get_dummies(cat_df)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment