I have a pandas dataframe, which looks like
Here one of column is named label, that can take only two possible values 0 or 1.
I would like to make histogram for label 1 and for label 0 separately one top of other, like
I am able to make this for one of the column (named "MA_CL05") like:
temp = infile.groupby('label')
for k, v in temp:
if k == 1:
v.MA_CL05.hist(label='1',figsize=(15,15),bins=25,alpha=1.0,histtype = 'step',lw=4)
if k == 0:
v.MA_CL05.hist(label='0',figsize=(15,15),bins=25,alpha=1.0,histtype = 'step',lw=4)
plt.legend(loc=1, prop={'size': 51})
plt.show()
I can copy and past this patch for all of 20 columns and it will be fine. But, is there any easy way to plot this histogram of type (2) in one go?
