df = pd.DataFrame({'amount': np.random.randint(1, 10, dates.size), 'col1':
    np.random.choice(codes, dates.size), 'col2': np.random.choice(codes,
    dates.size), 'date': dates})
kw = lambda x: x.isocalendar()[1]
kw_year = lambda x: str(x.year) + ' - ' + str(x.isocalendar()[1])
grouped = df.groupby([df['date'].map(kw_year), 'col1'], sort=False,
    as_index=False).agg({'amount': 'sum'})
A = grouped.pivot(index='date', columns='col1', values='amount').fillna(0
    ).reset_index()
ticks = A.date.values.tolist()
del A['date']
ax = A.plot(kind='bar')
ax.set_xticklabels(ticks)
Pandas: Group by calendar-week, then plot grouped barplots for the real datetime