-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
DOC: update the pandas.Series.dt.is_year_end docstring #20274
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
DOC: update the pandas.Series.dt.is_year_end docstring #20274
Conversation
Hello @janelle! Thanks for updating the PR.
Comment last updated on March 14, 2018 at 18:55 Hours UTC |
pandas/core/indexes/datetimes.py
Outdated
"Logical indicating if last day of year (defined by frequency)") | ||
""" | ||
Return a boolean indicating whether the date is the last day of the | ||
year. |
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 should be a single line. Does
Return a boolean array of whether the date is the year's last day.
fit on a single line?
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.
Boolean array is not correct in case of Series ...
(but I agree that just "boolean" does not reflect is returns a boolean for each element)
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.
Perhaps just
Return an indicator for whether each date is the last day of the year.
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.
Yes, that's better. Or maybe even shorter "Indicate whether ..." instead of "Return an indicator whether .." ?
pandas/core/indexes/datetimes.py
Outdated
1 True | ||
2 False | ||
dtype: bool | ||
""") |
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.
Could you add an example with just a DatetimeIndex? Can be the same values, and don't have to show the values again,
>>> pd.date_range('2017-12-30", periods=3).is_year_end
and show the output
pandas/core/indexes/datetimes.py
Outdated
|
||
Returns | ||
------- | ||
is_year_end : Series of boolean. |
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.
Ah, this return type depends on the type of self. So I think
is_year_end : Series or DatetimeIndex
The same type as the original data. Series will have the same
name and index. DatetimeIndex will have the same name.
pandas/core/indexes/datetimes.py
Outdated
|
||
See Also | ||
-------- | ||
is_year_start : Return a boolean indicating whether the date is the |
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.
See comment #20275 (comment) (once we figure out how to handle these)
[ci skip]
[ci skip]
Updated. Fixed some some See Alsos in the other docstrings where we said Thanks again @janelle! |
Checklist for the pandas documentation sprint (ignore this if you are doing
an unrelated PR):
scripts/validate_docstrings.py <your-function-or-method>
git diff upstream/master -u -- "*.py" | flake8 --diff
python doc/make.py --single <your-function-or-method>
Please include the output of the validation script below between the "```" ticks:
If the validation script still gives errors, but you think there is a good reason
to deviate in this case (and there are certainly such cases), please state this
explicitly.