-
-
Notifications
You must be signed in to change notification settings - Fork 18.6k
DOC: update the pandas.Series.dt.is_quarter_start docstring #20278
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_quarter_start docstring #20278
Conversation
Hello @janelle! Thanks for updating the PR. Cheers ! There are no PEP8 issues in this Pull Request. 🍻 Comment last updated on March 14, 2018 at 18:47 Hours UTC |
pandas/core/indexes/datetimes.py
Outdated
@@ -1735,7 +1735,33 @@ def freq(self, value): | |||
is_quarter_start = _field_accessor( | |||
'is_quarter_start', | |||
'is_quarter_start', | |||
"Logical indicating if first day of quarter (defined by frequency)") | |||
""" | |||
Return a boolean indicating whether the date is the first day of a |
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.
Does
Return an indicator for if the date is the first day of the quarter.
fit on a single line?
pandas/core/indexes/datetimes.py
Outdated
|
||
See Also | ||
-------- | ||
quarter : Return the quarter of the date. |
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 currently unresolved discussion in #20275 (comment)
pandas/core/indexes/datetimes.py
Outdated
|
||
Returns | ||
------- | ||
is_quarter_start : 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.
is_quarter_start : 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
>>> df = pd.DataFrame({'dates': pd.date_range("2017-03-30", | ||
... periods=4)}) | ||
>>> df.assign(quarter = df.dates.dt.quarter, | ||
... is_quarter_start = df.dates.dt.is_quarter_start) |
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.
PEP: one more space.
pandas/core/indexes/datetimes.py
Outdated
Examples | ||
-------- | ||
>>> df = pd.DataFrame({'dates': pd.date_range("2017-03-30", | ||
... periods=4)}) |
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.
PEP8: periods under the opening quote in date_range(
pandas/core/indexes/datetimes.py
Outdated
1 2017-03-31 1 False | ||
2 2017-04-01 2 True | ||
3 2017-04-02 2 False | ||
""") |
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.
Add a second example with just DatetimeIndex.is_quarter_start
.
[ci skip]
[ci skip]
Thanks again :) |
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.