text_plain_output_1.png
import matplotlib.pyplot as plt

import numpy as np

import pandas as pd

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

dataset.isnull().sum()

features_with_na = []
for features in dataset.columns:
    if dataset[features].isnull().sum() > 1:
        features_with_na.append(features)
features_with_na

features_with_na = [features for features in dataset.columns if dataset[features].isnull().sum() > 1]

for feature in features_with_na:
    data = dataset.copy()
    data[feature] = np.where(data[feature].isnull(), 1, 0)

numerical_features = [feature for feature in dataset.columns if dataset[feature].dtypes != 'O']
print('Number of numerical variables: ', len(numerical_features))
dataset[numerical_features].head()