Skip to content

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

Merged
merged 17 commits into from
Jul 8, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions pandas/_libs/tslibs/period.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1408,6 +1408,25 @@ cdef class _Period(object):

@property
def qyear(self):
"""
Return a year of the given date.

Copy link
Contributor

Choose a reason for hiding this comment

The 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."

This function simply find the year of the given date that period fallsin.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can get rid of extended summary because its already clear from summary


Returns
-------
int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int --> year : int (or qyear : int)


See Also
--------
Period.qyear :Return the year of the date
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add pqyear in See Also section

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the spacing here? Space after the :


Examples
--------
>>> p = pd.Period("2014-9-21", freq="A")
>>> p.qyear
2014
"""
base, mult = get_freq_code(self.freq)
return pqyear(self.ordinal, base)

Expand Down