How to do it...

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:

  1. 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:

  1. 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 ...

Get Ensemble Machine Learning Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.