Skip to content

Instantly share code, notes, and snippets.

@AyishaR
Created February 20, 2021 08:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AyishaR/d00424356dafbb21fc84c0ca7bdc6166 to your computer and use it in GitHub Desktop.
Save AyishaR/d00424356dafbb21fc84c0ca7bdc6166 to your computer and use it in GitHub Desktop.
# One hot encoding the input column
df_dummies = pd.get_dummies(df['Spectral Class'], drop_first = True, prefix = 'Spectral')
for column in df_dummies:
df[column] = df_dummies[column]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment