-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: Update pandas.Series.between_time docstring params #32014
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 pandas.Series.between_time docstring params #32014
Conversation
pandas/core/generic.py
Outdated
@@ -7538,16 +7538,21 @@ def between_time( | |||
Parameters | |||
---------- | |||
start_time : datetime.time or str | |||
The first time value. |
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.
Too much indentation, should be four spaces.
Can you be more specific of what start_time should be? This description doesn't clarify much to 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.
Got it, let me try to add more detail.
pandas/core/generic.py
Outdated
include_start : bool, default True | ||
Adding start_time value in the result. |
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.
Looks good, but I would rephrase to something like "whether the start time needs to be included in the result".
I find a bit confusing when you say "Adding", since you're telling users here what they should provide in this parameter.
pandas/core/generic.py
Outdated
.. versionadded:: 0.24.0 | ||
|
||
Returns | ||
------- | ||
Series or DataFrame | ||
If axis set on columns, it will return DataFrame format, vice versa. |
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'd say something like "data from the original object filtered to the specified dates"
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.
Lgtm, thanks!
Thanks @adamwidi |
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
output from python scripts/validate_docstrings.py pandas.Series.between_time:
################################################################################
#################### Docstring (pandas.Series.between_time) ####################
################################################################################
Select values between particular times of the day (e.g., 9:00-9:30 AM).
By setting
start_time
to be later thanend_time
,you can get the times that are not between the two times.
Parameters
start_time : datetime.time or str
The first time value.
end_time : datetime.time or str
The second time value.
include_start : bool, default True
Adding start_time value in the result.
include_end : bool, default True
Adding end_time value in the result.
axis : {0 or 'index', 1 or 'columns'}, default 0
Determine range time on index or columns value.
.. versionadded:: 0.24.0
Returns
Series or DataFrame
If axis set on columns, it will return DataFrame format, vice versa.
Raises
TypeError
If the index is not a :class:
DatetimeIndex
See Also
at_time : Select values at a particular time of the day.
first : Select initial periods of time series based on a date offset.
last : Select final periods of time series based on a date offset.
DatetimeIndex.indexer_between_time : Get just the index locations for
values between particular times of the day.
Examples
You get the times that are not between two times by setting
start_time
later thanend_time
:################################################################################
################################## Validation ##################################
################################################################################