Skip to content

Instantly share code, notes, and snippets.

@VincentTatan
Last active May 3, 2020 03:23
Show Gist options
  • Save VincentTatan/6ac56c1835b45eb881fc44fd29d133f1 to your computer and use it in GitHub Desktop.
Save VincentTatan/6ac56c1835b45eb881fc44fd29d133f1 to your computer and use it in GitHub Desktop.
def create_layered_boxplot(df,features, target_feature, subtitle='layered boxplot', kind='count',figsize=(20,7)):
n_charts = len(features)
fig, axes = plt.subplots(ncols=n_charts,figsize=figsize)
fig.suptitle(subtitle, fontsize=16)
for i in range(n_charts):
feature = features[i-1]
sns.boxplot(x=target_feature,y=feature,data=df,ax=axes[i-1])
df[feature].describe()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment