Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created March 16, 2020 10: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 aniruddha27/03f09065ec863c67fcc60ceef645a2a0 to your computer and use it in GitHub Desktop.
Save aniruddha27/03f09065ec863c67fcc60ceef645a2a0 to your computer and use it in GitHub Desktop.
# Ordinal features
train['CentralAir'].replace(['N','Y'],[0,1],inplace=True)
# Nominal features
for i in ['HeatingQC','ExterCond','ExterQual']:
train[i].replace(['Ex','Gd','TA','Fa','Po'],[4,3,2,1,0],inplace=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment