csv_df.rename(columns=lambda x: str(x.year) + 'Q' + str(x.quarter), inplace
    =True)
csv_df = csv_df.groupby(csv_df.columns, axis=1).mean()
pandas how to use groupby to group columns by date in the label?