application_vnd.jupyter.stderr_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
pd.pandas.set_option('display.max_columns', None)

data = pd.read_csv('houseprice.csv')

vars_with_na = [var for var in data.columns if data[var].isnull().sum() > 1]

def analyse_na_value(df, var):
    df = df.copy()
    df[var] = np.where(df[var].isnull(), 1, 0)
    df.groupby(var)['SalePrice'].median().plot.bar()
    plt.title(var)
    plt.show()
for var in vars_with_na:
    analyse_na_value(data, var)