-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Update the Period.day docstring #20294
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 |
---|---|---|
|
@@ -1217,6 +1217,32 @@ cdef class _Period(object): | |
|
||
@property | ||
def day(self): | ||
""" | ||
Return the number of days of particular month of a given Period. | ||
|
||
This attribute returns the total number of days of given month on which | ||
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. This is a pretty simple function so depending on how concise the short summary is might be OK to not have an extended summary 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. but I think when I remove extended summary validation_docstring.py gives error ??? 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. You are right that the script would fail but I think this would pass as an exception |
||
the particular date occurs. | ||
|
||
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. lowercase this |
||
Number of days till particular date | ||
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. This should be indented. Might want to reword based off of what you do with short summary 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. still have confusion ? 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. Take a look at the contributing guide for the sprint. The very first example should show you how to format the Returns section https://python-sprints.github.io/pandas/guide/pandas_docstring.html 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 write : 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. or day of given month 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. Just write int here - this is simple enough that you don't need a description For future reference though when you do put a description on the line below the type it needs to be indented (i.e. 4 spaces ahead of the line above) 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 | ||
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. Capitalize Also |
||
-------- | ||
Period.dayofweek | ||
Return the day of the week | ||
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. In this section the description should be on the same line as the referenced item separated by a " : " 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. mean ===>>>>(Period.dayofweek: Return the day of the week) 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. Put a space before the colon and change the word "Return" to "Get" and yes you are correct |
||
|
||
Period.dayofyear | ||
Return the day of the year | ||
|
||
Examples | ||
-------- | ||
>>> import pandas as pd | ||
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. No need for 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. sorry my mistake |
||
>>> p = pd.Period("2018-03-11", freq='H') | ||
>>> p.day | ||
11 | ||
""" | ||
base, mult = get_freq_code(self.freq) | ||
return pday(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.
This description would make me think this gives the number of days of the month the period falls in, i.e. if the month was February it would return 28. That's obviously note the case - can you think of a way to reword and make clearer?
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.
sure I try to make this more clear I'm still thinking that summary is not good sense .
I have query : if we give any period like 2018-03-28 it return 28 so how i explain because I think it count all days till given date ?
If I think wrong correct me :)
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.
I would say "Get day of the month that a Period falls on"
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.
I didn't find better sort explanation as you mention on above comment