application_vnd.jupyter.stderr_output_1.png
import pandas as pd

adult = pd.read_csv('adult.csv', na_values=['?', ',', 'NaN'])

adult.dtypes

adult.shape

adult.columns

adult = adult.drop('fnlwgt', axis=1)

adult = adult.replace('>50K', 1)
adult = adult.replace('<=50K', 0)

adult.isnull().sum()

adult.workclass.value_counts()
adult = adult.fillna({'workclass': 'Private'})

adult.occupation.value_counts()
adult = adult.fillna({'occupation': 'Prof-specialty'})

adult.dropna(axis=0, inplace=True)

adult.isnull().sum()

adult.dtypes