I am trying to group all values into months and plot these as a bar chart. Below is what I have tried thus far:
import pandas as pd
d1 = ({
'Date' : ['1/7/18','1/7/18','1/8/18','1/8/18','1/9/18'],
'Value' : ['Foo','Bar','Foo','Bar','Foo'],
})
df1 = pd.DataFrame(data = d1)
df1['Date'] = pd.to_datetime(df1['Date'])
df1.set_index('Date', inplace = True)
df1.resample('1M').count()['Value'].plot(kind = 'bar')
But this only produces one bar with a count of 5. I'm hoping the intended output would be 3 separate bars. A count of 2 for July, 2 for August, and 1 for September.


