-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: update the Period.qyear docstring #20333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 16 commits
4cc00bf
801e9b3
21ce297
799732f
d0c5102
fd47e6f
b5a9902
9a82c48
1973157
3104470
0510c71
9f03a90
73299d4
4c5697a
b66ede1
0013c64
ca3beb5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1463,6 +1463,45 @@ cdef class _Period(object): | |
|
||
@property | ||
def qyear(self): | ||
""" | ||
Get the fiscal year component of the Period. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. year of the given date not appropriate . I'd say "Get the year component of the Period." |
||
The `year` and the `qyear` of the period will be the same if the fiscal | ||
and the natural years are the same. When they are not, the fiscal year | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "natural" --> "calendar" |
||
can be different from the natural year of the period. | ||
|
||
Returns | ||
------- | ||
int | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
||
See Also | ||
-------- | ||
Period.year : Return the natural year of the period. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. natural --> calendar |
||
|
||
Examples | ||
-------- | ||
|
||
If the natural and fiscal year are the same, `qyear` and `year` will | ||
be the same. | ||
|
||
>>> per = pd.Period('2018Q1', freq='Q') | ||
>>> per.qyear | ||
2018 | ||
>>> per.year | ||
2018 | ||
|
||
If the fiscal year starts in April (`Q-MAR`), the first qearter of | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. qearter --> quarter |
||
2018 will start in April 2017. `year` will then be 2018, but `qyear` | ||
will be the fiscal year, 2018. | ||
|
||
>>> per = pd.Period('2018Q1', freq='Q-MAR') | ||
>>> per.start_time | ||
Timestamp('2017-04-01 00:00:00') | ||
>>> per.qyear | ||
2018 | ||
>>> per.year | ||
2017 | ||
""" | ||
base, mult = get_freq_code(self.freq) | ||
return pqyear(self.ordinal, base) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Find the fiscal year the Period lies in according to the specified starting-quarter.