Skip to content

Instantly share code, notes, and snippets.

@AyishaR
Created January 22, 2021 16:02
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/5c2a76b355ce03bd1bf8803af790a70d to your computer and use it in GitHub Desktop.
Save AyishaR/5c2a76b355ce03bd1bf8803af790a70d to your computer and use it in GitHub Desktop.
# Labels as 1 - spam or 0 - ham
df['Category'] = df['Category'].apply(lambda x : 1 if x == 'spam' else 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment