text_html_output_1.png
import pandas as pd

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

dataset = '/kaggle/input/adult-dataset/adult.csv'
dataset = pd.read_csv(dataset, header=None, sep=',\\s')
dataset.shape

col_names = ['age', 'workclass', 'fnlwgt', 'education', 'education_num', 'marital_status', 'occupation', 'relationship', 'race', 'sex', 'capital_gain', 'capital_loss', 'hours_per_week', 'native_country', 'income']
dataset.columns = col_names
dataset.columns

categorical = [var for var in dataset.columns if dataset[var].dtype == 'O']

dataset[categorical].isnull().sum()