Can Pandas plot a histogram of dates?

前端 未结 8 1453
我在风中等你
我在风中等你 2020-11-28 03:15

I\'ve taken my Series and coerced it to a datetime column of dtype=datetime64[ns] (though only need day resolution...not sure how to change).

i         


        
8条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-11-28 04:16

    All of these answers seem overly complex, as least with 'modern' pandas it's two lines.

    df.set_index('date', inplace=True)
    df.resample('M').size().plot.bar()
    

提交回复
热议问题