Skip to content

Instantly share code, notes, and snippets.

@BinarySpoon
Created December 2, 2020 05:31
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 BinarySpoon/79ab2d255c8ea9e83b4e02ca21e91b2d to your computer and use it in GitHub Desktop.
Save BinarySpoon/79ab2d255c8ea9e83b4e02ca21e91b2d to your computer and use it in GitHub Desktop.
#PREPROCESSING -->
#-----------------
print('#PREPROCESSING')
# removing columns -->
drop_columns = ['Unnamed: 2','Unnamed: 3','Unnamed: 4']
data.drop(columns=drop_columns,axis=1,inplace=True)
rename_columns = {'v1':'label','v2':'message'}
data.rename(rename_columns,axis=1,inplace=True)
data.label = data.label.map({'ham':1,'spam':0})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment