I have a Pandas data frame with a date column (in a datetime format) containing 3 years of data. Since it is a lot, I have grouped by month and year and plotted a countplot with matplotlib.
The graph doesn't show my x-axis labels, and also I suspect the results are not accurate (the graph looks different on excel), how can I add the labels? and make sure they are grouped by in the right order?
Here is the relevant code:
df['datetime_colummn'].groupby([df.datetime_colummn.dt.year.rename('year'),
df.datetime_colummn.dt.month.rename('month')]).agg('count').plot()