text_html_output_1.png
import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

dtrain = pd.read_csv('/kaggle/input/house-prices-advanced-regression-techniques/train.csv')
dtest = pd.read_csv('/kaggle/input/house-prices-advanced-regression-techniques/test.csv')
dtrain

total = dtrain.isnull().sum().sort_values(ascending=False)
percent = (dtrain.isnull().sum() / dtrain.isnull().count()).sort_values(ascending=False)
missing_values = pd.concat([total, percent], axis=1, keys=['total', 'percent'])

dtrain = dtrain.drop(missing_values[missing_values['percent'] > 0.8].index, 1)
dtest = dtest.drop(missing_values[missing_values['percent'] > 0.8].index, 1)

extreme = dtrain['MasVnrArea'].mean() + 3 * dtrain['MasVnrArea'].std()
dtrain['MasVnrArea'] = dtrain['MasVnrArea'].fillna(extreme)
dtrain['MasVnrArea'].isnull().mean()