Skip to content

Instantly share code, notes, and snippets.

@vanbrands
Last active July 24, 2020 20:11
Show Gist options
  • Save vanbrands/8cc6b18970f5d6a896982f368ef30375 to your computer and use it in GitHub Desktop.
Save vanbrands/8cc6b18970f5d6a896982f368ef30375 to your computer and use it in GitHub Desktop.
from sklearn.preprocessing import OneHotEncoder
encoder = OneHotEncoder()
dummies = encoder.fit_transform(df['categorical_column'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment