This is my pandas dataframe df
:
ab channel booked
0 control book_it 466
1 control contact_me 536
2 control instant 17
3 treatment book_it 494
4 treatment contact_me 56
5 treatment instant 22
I want to plot 3 groups of bar chart (according to channel
):
for each channel:
plot control booked value vs treatment booked value.
hence i should get 6 bar charts, in 3 groups where each group has control and treatment booked values.
SO far i was only able to plot booked but not grouped by ab:
ax = df_conv['booked'].plot(kind='bar',figsize=(15,10), fontsize=12)
ax.set_xlabel('dim_contact_channel',fontsize=12)
ax.set_ylabel('channel',fontsize=12)
plt.show()
This is what i want (only show 4 but this is the gist):
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…