Skip to content

Instantly share code, notes, and snippets.

@Shikhargupta
Created May 11, 2020 18:12
Show Gist options
  • Select an option

  • Save Shikhargupta/5d4ddd01eb51dc2d91b846f2a2dc6777 to your computer and use it in GitHub Desktop.

Select an option

Save Shikhargupta/5d4ddd01eb51dc2d91b846f2a2dc6777 to your computer and use it in GitHub Desktop.
handling_nan
#For BsmtFinSF1 we observed the only datapoint for which the value was missing had BsmtFinType1 as NA i.e
#there is no basement. So we can fill the SF as 0
df_cum['BsmtFinSF1'] = df_cum['BsmtFinSF1'].fillna(0)
#Same goes for BsmtFinSF2
df_cum['BsmtFinSF2'] = df_cum['BsmtFinSF2'].fillna(0)
#Same data point is valid for BsmtUnfSF and TotalBsmtSF. We can fill them all with zeros.
df_cum['BsmtUnfSF'] = df_cum['BsmtUnfSF'].fillna(0)
df_cum['TotalBsmtSF'] = df_cum['TotalBsmtSF'].fillna(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment