Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created March 16, 2020 10:03
Show Gist options
  • Save aniruddha27/d8fe5d25d25dbd67dc570acca1814869 to your computer and use it in GitHub Desktop.
Save aniruddha27/d8fe5d25d25dbd67dc570acca1814869 to your computer and use it in GitHub Desktop.
train['HasPool'] = train['PoolArea'].apply(lambda x: 1 if x>0 else 0)
train['HasFirePlace'] = train['FireplaceQu'].apply(lambda x: 1 if x>0 else 0)
train['HasFence'] = train['Fence'].apply(lambda x: 1 if x>0 else 0)
train['HasMsonary'] = train['MasVnrArea'].apply(lambda x: 1 if x>0 else 0)
train['HasGarage'] = train['GarageArea'].apply(lambda x: 1 if x>0 else 0)
train['HasBsmt'] = train['TotalBsmtSF'].apply(lambda x: 1 if x>0 else 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment