text_plain_output_1.png
import matplotlib.pyplot as plt

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

import seaborn as sns

data = pd.read_csv('../input/house-prices-advanced-regression-techniques/train.csv')
test_data = pd.read_csv('../input/house-prices-advanced-regression-techniques/test.csv')

data.describe().T

columns_to_drop = []
columns_to_model = []
non_sparse_column_percentage = 90
for col in data.columns:
    if data[data[col].notnull()][col].count() / len(data) * 100 != 100:
        if data[data[col].notnull()][col].count() / len(data) * 100 < non_sparse_column_percentage:
            columns_to_drop.append(col)
        else:
            columns_to_model.append(col)
    else:
        columns_to_model.append(col)

data = data[columns_to_model]
for col in columns_to_model:
    data = data[data[col].notnull()]

numerical_features = []
categorical_features = []
for col in data:
    if (data[col].dtype == int) | (data[col].dtype == float):
        numerical_features.append(col)
    else:
        categorical_features.append(col)

for feature in categorical_features:
    print(f"{feature}: (Unique Count = {len(data[feature].unique())})\n\n{data[feature].unique()}\n\n{'*' * 75}")