Skip to content

Instantly share code, notes, and snippets.

@VincentTatan
Last active May 3, 2020 03:24
Show Gist options
  • Save VincentTatan/9c205d72d5bf3a2e3fcd745f49bd15f0 to your computer and use it in GitHub Desktop.
Save VincentTatan/9c205d72d5bf3a2e3fcd745f49bd15f0 to your computer and use it in GitHub Desktop.
def create_box_and_scatter_plot(df,feature_1,feature_2,target_feature,figsize=(10,5)):
fig, ax =plt.subplots(1,2,figsize=figsize)
sns.boxplot(x=target_feature, y= feature_1, data=df, ax=ax[0]).set_title(feature_1)
sns.boxplot(x=target_feature, y= feature_2, data=df, ax=ax[1]).set_title(feature_2)
fig2, ax2 =plt.subplots(1,1,figsize=figsize)
sns.scatterplot(x=feature_1, y=feature_2, hue=target_feature, data=df, ax = ax2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment