id timestamp energy
0 a 2012-03-18 10:00:00 0.034
1 b 2012-03-20 10:30:00 0.052
2 c 2013-05-29 11:00:00 0.055
3 d 2014-06-20 01:00:00 0.028
4 a 2015-02-10 12:00:00 0.069
I want to plot these data like below. just time on x-axis, not date nor datetime.
because I want to see the values per each hour.
https://i.sstatic.net/u73eJ.png
but this code plot like this.
plt.plot(df['timestamp'], df['energy'])
https://i.sstatic.net/yd6NL.png
I tried some codes but they just format the X data hide date part and plot like second graph.
+ df['timestamp'] is datetime type.
what should I do? Thanks.
df['timestamp']withdf['timestamp'].dt.time