#!/usr/bin/env python # coding: utf-8 # In[ ]: from pycaret.datasets import get_data data = get_data('insurance') import matplotlib.pyplot as plt import seaborn as sns # In[ ]: data.info() # In[ ]: sns.set_style('darkgrid') colors = ['#851836', '#EDBD17', '#0E1428', '#407076', '#4C5B61'] sns.set_palette(sns.color_palette(colors)) # In[ ]: categorical = ['sex', 'children', 'smoker', 'region'] fig, axs = plt.subplots(2, 2, figsize=(20,10)) for variable, ax in zip(categorical, axs.flatten()): sns.histplot(data, x='charges', hue=variable, multiple='stack', ax=ax) # In[ ]: