Skip to content

Instantly share code, notes, and snippets.

@wibowotangara
Created January 23, 2024 05:52
Show Gist options
  • Save wibowotangara/38945bc02e669ad26011aac30d8964ce to your computer and use it in GitHub Desktop.
Save wibowotangara/38945bc02e669ad26011aac30d8964ce to your computer and use it in GitHub Desktop.
categorical_cols = [col for col in df.select_dtypes(include='object').columns.tolist()]
onehot = pd.get_dummies(df[categorical_cols], drop_first=True)
onehot = onehot.drop(columns=['loan_label_good'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment