标签: python pandas matplotlib
df1=df.groupby(['usertype','day']).size().reset_index(name='times')
如何按组日和用户类型绘制条形图。
答案 0 :(得分:0)
我想你想要这个:
days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] >>> df.pivot(index="day", columns="usertype", values="times").reindex(days).plot.bar()