text_plain_output_1.png
import pandas as pd

train = pd.read_csv('../input/home-data-for-ml-course/train.csv')
test = pd.read_csv('../input/home-data-for-ml-course/test.csv')
id = test['Id']

train.describe

train.dtypes.unique()

list(train.select_dtypes(include=['int64']).columns)

list(train.select_dtypes(include=['float64']).columns)

list(train.select_dtypes(include=['O']).columns)

train.drop(['Id', 'YrSold', 'MoSold'], inplace=True, axis=1)
test.drop(['Id', 'YrSold', 'MoSold'], inplace=True, axis=1)

train.isnull().mean().round(4).mul(100).sort_values(ascending=False)

train = train.loc[:, train.isnull().mean() < 0.4]
test = test.loc[:, test.isnull().mean() < 0.4]
train.shape