text_plain_output_1.png
import datetime

import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

df = pd.read_excel('/kaggle/input/arketing-campaign/marketing_campaign.xlsx')
df

df.shape

df.isnull().sum()

df.isnull().sum()

df.Year_Birth = pd.to_datetime(df['Year_Birth'], format='%Y')
year_now = datetime.date.today().year
df['Age'] = df['Year_Birth'].apply(lambda x: year_now - x.year)
df.drop('Year_Birth', axis=1, inplace=True)

fig, ax = plt.subplots(1, 2, figsize=(18, 4))
sns.scatterplot(x='Age', y='Income', data=df, hue='Response', ax=ax[0])
sns.boxplot(x='Age', data=df, ax=ax[1])
plt.show()