monthly = monthly.reset_index() monthly['date'] = monthly['date'].apply(lambda x: x.strftime('%Y-%m')) monthly.set_index('date', inplace=True)