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

data = pd.read_csv('/kaggle/input/income/train.csv')
data.shape

all_columns = list(data.columns)
all_columns

data.isna().sum()

def event_rate_analysis(column, target):
    temp = (data.groupby(column)[target].sum() / data[target].sum()).to_frame().reset_index()
    temp['Volume'] = (data.groupby(column)[target].count() / data[target].count()).to_list()
    temp = temp.sort_values(target, ascending=False)

event_rate_analysis('workclass', 'income_>50K')