Let's start by analyzing variables with missing values. Set the options in pandas to view all rows and columns, as shown in the previous section:
- With the following syntax, we can see which variables have missing values:
# Check which variables have missing valuescolumns_with_missing_values = housepricesdata.columns[housepricesdata.isnull().any()]housepricesdata[columns_with_missing_values].isnull().sum()
This will produce the following output:
- You might also like to see the missing values in terms of percentages. To see the count and percentage of missing values, execute the following command:
import numpy as npimport ...