我试着做一个数据透视, A Y B Y C Ypivot=pd.pivot_table(dataframe,index=['column1'],columns=['column2'],values=['column1'], aggfunc={'column1'}, margins=False, fill
sample(5) of original dataframe 我使用了带有index=pd.Grouper(freq='M')的pd.pivot_table来获取每个按月分组的实体的值的总和。example of dataframe after pivot_table 我可以通过添加.plot()直接绘制pivot_table。aggfunc=np.sum).plot() .plot() directly after pivot_table ope