I have a DataFrame with columns in DateTime index, representing quarters such as: 2000-03-31 00:00:00
How can I do to transform this into '2000q1'?
I have looked around the docs, but they only mention DateTimeIndex.quarter
format='%Y%q' does not work. Neither does the option on='%Y%q
You can use
to_period("Q"):To convert a normal column
col, usedtto access theDatetimeobjects in the series: