pandas.Period.qyear#
- Period.qyear#
Fiscal year the Period lies in according to its starting-quarter.
如果财政年和日历年相同,则 Period 的 year 和 qyear 将相同。当它们不同时,财政年可能与 Period 的日历年不同。
- Returns:
- int
Period 的财政年度。
参见
Period.year返回 Period 的日历年。
Examples
如果自然年和财政年相同,则 qyear 和 year 将相同。
>>> per = pd.Period('2018Q1', freq='Q') >>> per.qyear 2018 >>> per.year 2018
如果财政年从四月开始 (Q-MAR),则 2018 年的第一季度将从 2017 年四月开始。此时 year 将是 2017,而 qyear 将是财政年度 2018。
>>> per = pd.Period('2018Q1', freq='Q-MAR') >>> per.start_time Timestamp('2017-04-01 00:00:00') >>> per.qyear 2018 >>> per.year 2017