pandas format datetimeindex to quarters
问题 With a resample job, I have my monthly values converted to quarterly values: hs=hs.resample('QS',axis=1).mean() Works well, my columns look like this: hs.columns: DatetimeIndex(['2000-01-01', '2000-04-01', '2000-07-01', '2000-10-01', '2001-01-01', '2001-04-01', '2001-07-01', '2001-10-01', '2002-01-01', '2002-04-01', '2002-07-01', '2002-10-01', Now I want them to convert in the YYYYq[1-4] format, which I thought should be as easy as (according to this Link): hs.columns.strftime('%Yq%q') But