image_output_1.png
import matplotlib.pyplot as plt

import pandas as pd

import seaborn as sns

df = pd.read_csv('/kaggle/input/dataviz-facens-20182-ex3/BlackFriday.csv', delimiter=',')

fig, ax = plt.subplots(figsize=(18,9))
plt.title('Valor Gasto por Faixa Etária', fontsize=14, fontweight = 'bold')

frame = plt.gca()
frame.spines['right'].set_visible(False)
frame.spines['top'].set_visible(False) 

sns.violinplot(ax = ax, x="Age", y="Purchase", data=df[['Age','Purchase']].sort_values(by=['Age']),  palette="RdBu_r")

g = sns.catplot(x='Purchase', y='Gender', col='Age', data=df.sort_values(by=['Age']), col_wrap=1, orient='h', height=3, aspect=3, palette='Set3', kind='violin', dodge=True, bw=0.2)