Skip to content

Instantly share code, notes, and snippets.

@AyishaR
Created February 20, 2021 09:38
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/53648c99ccf0cf75bdfcceb855a66b43 to your computer and use it in GitHub Desktop.
Save AyishaR/53648c99ccf0cf75bdfcceb855a66b43 to your computer and use it in GitHub Desktop.
# One hot encoding the output column
y = pd.get_dummies(df['Star type'])
# Dropping the encoded columns
df = df.drop(columns = ['Spectral Class', 'Star type', 'Star color'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment