File tree 1 file changed +39
-0
lines changed
1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -1463,6 +1463,45 @@ cdef class _Period(object):
1463
1463
1464
1464
@property
1465
1465
def qyear (self ):
1466
+ """
1467
+ Fiscal year the Period lies in according to its starting-quarter.
1468
+
1469
+ The `year` and the `qyear` of the period will be the same if the fiscal
1470
+ and calendar years are the same. When they are not, the fiscal year
1471
+ can be different from the calendar year of the period.
1472
+
1473
+ Returns
1474
+ -------
1475
+ int
1476
+ The fiscal year of the period.
1477
+
1478
+ See Also
1479
+ --------
1480
+ Period.year : Return the calendar year of the period.
1481
+
1482
+ Examples
1483
+ --------
1484
+ If the natural and fiscal year are the same, `qyear` and `year` will
1485
+ be the same.
1486
+
1487
+ >>> per = pd.Period('2018Q1', freq='Q')
1488
+ >>> per.qyear
1489
+ 2018
1490
+ >>> per.year
1491
+ 2018
1492
+
1493
+ If the fiscal year starts in April (`Q-MAR`), the first quarter of
1494
+ 2018 will start in April 2017. `year` will then be 2018, but `qyear`
1495
+ will be the fiscal year, 2018.
1496
+
1497
+ >>> per = pd.Period('2018Q1', freq='Q-MAR')
1498
+ >>> per.start_time
1499
+ Timestamp('2017-04-01 00:00:00')
1500
+ >>> per.qyear
1501
+ 2018
1502
+ >>> per.year
1503
+ 2017
1504
+ """
1466
1505
base, mult = get_freq_code(self .freq)
1467
1506
return pqyear(self .ordinal, base)
1468
1507
You can’t perform that action at this time.
0 commit comments