Imputing missing values of LoanAmount
There are multiple ways to fill the missing values of continuous variables. You can replace them with mean, median or estimate values based on other features of the data set.
For the sake of simplicity, we would impute the missing values of LoanAmount by mean value (Mean of available values of LoanAmount).
train['LoanAmount'].fillna(train['LoanAmount'].mean(), inplace=True)
This exercise is part of the course
Introduction to Python & Machine Learning (with Analytics Vidhya Hackathons)
Exercise instructions
Impute missing values with a specific value 168
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Impute missing value of LoanAmount with 168 for test data set
test['LoanAmount'].fillna(______, inplace=True)