Last active
November 22, 2020 04:40
-
-
Save VincentTatan/2477da2417e59b19bec0017db5fb8d96 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def draw_plot(df,features,subtitle,figsize=(20,3),type='distplot'): | |
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] | |
if len(features) >1: | |
ax=axes[i-1] | |
else: | |
ax=axes | |
if type=='countplot': | |
sns.countplot(df[feature],ax=ax) | |
elif type=='distplot': | |
sns.distplot(df[feature],ax=ax) | |
df[feature].describe() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment