pandas.Series.dt.qyear#
- Series.dt.qyear[source]#
Fiscal year each period lies in, according to its starting quarter.
The year and the qyear of a period will be the same if the fiscal and calendar years are the same. When they are not, the fiscal year can be different from the calendar year of the period.
See also
PeriodIndex.qyearFiscal year of each period in a PeriodIndex.
Period.qyearFiscal year of a single Period.
Examples
If the fiscal year starts in April (Q-MAR), the first quarter of fiscal 2018 starts in April 2017, so its year is 2017 while its qyear is 2018.
>>> ser = pd.Series(pd.period_range("2018Q1", periods=4, freq="Q-MAR")) >>> ser 0 2018Q1 1 2018Q2 2 2018Q3 3 2018Q4 dtype: period[Q-MAR] >>> ser.dt.qyear 0 2018 1 2018 2 2018 3 2018 dtype: int64 >>> ser.dt.year 0 2017 1 2017 2 2017 3 2018 dtype: int64