I have this dataframe
df[['payout_date','total_value']].head(10)
payout_date total_value
0 2017-02-14T11:00:06 177.313
1 2017-02-14T11:00:06 0.000
2 2017-02-01T00:00:00 0.000
3 2017-02-14T11:00:06 47.392
4 2017-02-14T11:00:06 16.254
5 2017-02-14T11:00:06 125.818
6 2017-02-14T11:00:06 0.000
7 2017-02-14T11:00:06 0.000
8 2017-02-14T11:00:06 0.000
9 2017-02-14T11:00:06 0.000
I am using this code to plot the aggregated sum of total_value within specific date-range by day (and by month), but it plots a bar for each total_value and doesn't sum-aggregate total_value by day.
(df.set_index('payout_date')
.loc['2018-02-01':'2018-02-02']
.groupby('payout_date')
.agg(['sum'])
.reset_index()
.plot(x='payout_date', y='total_value',kind="bar"))
plt.show()
Data is not aggregated, I get bar for each value from df:
How to aggregate total_value by date and by month?
I tried to use answers from this and couple other similar questions but none of them worked for the date format that is used here.
I also tried adding .dt.to_period('M') to the code but I get TypeError: Empty 'DataFrame': no numeric data to plot error.

