pandas.PeriodIndex.qyear#
- property PeriodIndex.qyear[source]#
Fiscal year the Period lies in according to its starting-quarter.
The year and the qyear of the 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.
- Returns:
- Index
The fiscal year of each period.
See also
PeriodIndex.quarterThe quarter of the date.
PeriodIndex.yearThe year of the period.
Examples
If the natural and fiscal year are the same, qyear and year will be the same.
>>> idx = pd.PeriodIndex(["2018Q1"], freq="Q") >>> idx.qyear Index([2018], dtype='int64') >>> idx.year Index([2018], dtype='int64')
If the fiscal year starts in April (Q-MAR), the first quarter of 2018 will start in April 2017. year will then be 2017, but qyear will be the fiscal year, 2018.
>>> idx = pd.PeriodIndex(["2018Q1"], freq="Q-MAR") >>> idx.start_time DatetimeIndex(['2017-04-01'], dtype='datetime64[us]', freq=None) >>> idx.qyear Index([2018], dtype='int64') >>> idx.year Index([2017], dtype='int64')