Skip to content

Instantly share code, notes, and snippets.

@redpoint13
Created December 28, 2018 16:14
Show Gist options
  • Save redpoint13/5e1568bc0586abc33764a2d485fcd9a8 to your computer and use it in GitHub Desktop.
Save redpoint13/5e1568bc0586abc33764a2d485fcd9a8 to your computer and use it in GitHub Desktop.
for c in cols_cat:
df = pd.concat([df, pd.get_dummies(df[c], prefix=c,dummy_na=True)], axis=1).drop([c], axis=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment