-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC : Update the pandas.Period.hour docstring #20312
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 1 commit
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 |
---|---|---|
|
@@ -1241,6 +1241,24 @@ cdef class _Period(object): | |
|
||
@property | ||
def hour(self): | ||
""" | ||
Get hours of a day that a Period falls on. | ||
|
||
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. For the explanation note that it's betwene 0 and 23.
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. sure |
||
|
||
See Also | ||
-------- | ||
Period.minute : Get the minute of hour | ||
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. "minute of hour" -> "minute of the Period." (end with a |
||
Period.second : Get the second of hour | ||
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. "second of hour" -> "second of the Period." (end with a .). |
||
|
||
Examples | ||
-------- | ||
>>> p = pd.Period("2018-03-11 13:03:12.050000") | ||
>>> p.hour | ||
13 | ||
""" | ||
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. Can you add an example with a period longer than a day, to show that it uses 0?
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. can I add this too
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. Yes, please do (with the |
||
base, mult = get_freq_code(self.freq) | ||
return phour(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.
Maybe "Get the hour of the day component of a Period."? Since a Period can span multiple days.
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.
Yup Period can span multiple days .Its really hard to define accurate sentance ... day conponent of the period sounds more clear.