So I'm trying to plot histograms for all my continous variables in my DatFrame using a for loop I've already managed to do this for my categorical variables using countplot with the following code:
df1 = df.select_dtypes([np.object])
for i, col in enumerate(df1.columns):
plt.figure(i)
sns.countplot(x=col, data=df1)
Which I found here by searching SO.
However now I want to do the same with distplot so I tried modifying the above code to:
df1 = dftest.select_dtypes([np.int, np.float])
for i, col in enumerate(df1.columns):
plt.figure(i)
sns.distplot(df1)
But it just gived me one empty plot. Any ideas on what I can do?
edit: e.g of DataFrame:
dftest = pd.DataFrame(np.random.randint(low=0, high=10, size=(5, 5)),
columns=['a', 'b', 'c', 'd', 'e'])