image_output_1.png
import pandas as pd

df = pd.read_csv('../input/customer-personality-analysis/marketing_campaign.csv', delimiter='\\t', engine='python')

df_mod = df
df_mod['Dt_Customer'] = pd.to_datetime(df['Dt_Customer'], format='%d-%m-%Y')
df_mod['Age'] = max(df_mod.Dt_Customer.dt.year) - df['Year_Birth']
df_mod = df.rename(columns={'Response': 'AcceptedCmp6'})
df_mod = df_mod.drop(columns=['Z_Revenue', 'Z_CostContact'])

for i in df_mod.columns:
    if len(df_mod.loc[df_mod[i].isna()]) != 0:
        print(i, len(df_mod.loc[df_mod[i].isna()]))