我有一个像下面这样的数据帧。使用Python seeborn,我如何创建一个以每周的day_为x轴的条形图,并且对于每一天,有2个条形图来显示cr和clicks?在
df=pd.DataFrame({u'clicks': {0: 19462,
1: 11474,2: 32522,3: 16031,4: 12828,5: 7856,6: 11395},
u'cr': {0: 0.0426,1: 0.0595,2: 0.0454,3: 0.0462,4: 0.0408,5: 0.0375,6: 0.0423},
u'day_of_week': {0: u'Friday',1: u'Monday',2: u'Saturday',3: u'Sunday',
4: u'Thursday',5: u'Tuesday',6: u'Wednesday'}})
Out[14]:
clicks cr day_of_week
0 19462 0.0426 Friday
1 11474 0.0595 Monday
2 32522 0.0454 Saturday
3 16031 0.0462 Sunday
4 12828 0.0408 Thursday
5 7856 0.0375 Tuesday
6 11395 0.0423 Wednesday
可以将matplotlib与Seaborn样式一起使用:
相关问题 更多 >
编程相关推荐