-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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: Updated docstrings related to DateTimeIndex. GH22459 #22504
Merged
jreback
merged 3 commits into
pandas-dev:master
from
eldritchideen:update-index-datetimes-docstrings
Nov 4, 2018
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1413,7 +1413,8 @@ def date_range(start=None, end=None, periods=None, freq=None, tz=None, | |
|
||
>>> pd.date_range(start='2018-04-24', end='2018-04-27', periods=3) | ||
DatetimeIndex(['2018-04-24 00:00:00', '2018-04-25 12:00:00', | ||
'2018-04-27 00:00:00'], freq=None) | ||
'2018-04-27 00:00:00'], | ||
dtype='datetime64[ns]', freq=None) | ||
|
||
**Other Parameters** | ||
|
||
|
@@ -1484,37 +1485,39 @@ def bdate_range(start=None, end=None, periods=None, freq='B', tz=None, | |
Parameters | ||
---------- | ||
start : string or datetime-like, default None | ||
Left bound for generating dates | ||
Left bound for generating dates. | ||
end : string or datetime-like, default None | ||
Right bound for generating dates | ||
Right bound for generating dates. | ||
periods : integer, default None | ||
Number of periods to generate | ||
Number of periods to generate. | ||
freq : string or DateOffset, default 'B' (business daily) | ||
Frequency strings can have multiples, e.g. '5H' | ||
Frequency strings can have multiples, e.g. '5H'. | ||
tz : string or None | ||
Time zone name for returning localized DatetimeIndex, for example | ||
Asia/Beijing | ||
Asia/Beijing. | ||
normalize : bool, default False | ||
Normalize start/end dates to midnight before generating date range | ||
Normalize start/end dates to midnight before generating date range. | ||
name : string, default None | ||
Name of the resulting DatetimeIndex | ||
Name of the resulting DatetimeIndex. | ||
weekmask : string or None, default None | ||
Weekmask of valid business days, passed to ``numpy.busdaycalendar``, | ||
only used when custom frequency strings are passed. The default | ||
value None is equivalent to 'Mon Tue Wed Thu Fri' | ||
value None is equivalent to 'Mon Tue Wed Thu Fri'. | ||
|
||
.. versionadded:: 0.21.0 | ||
|
||
holidays : list-like or None, default None | ||
Dates to exclude from the set of valid business days, passed to | ||
``numpy.busdaycalendar``, only used when custom frequency strings | ||
are passed | ||
are passed. | ||
|
||
.. versionadded:: 0.21.0 | ||
|
||
closed : string, default None | ||
Make the interval closed with respect to the given frequency to | ||
the 'left', 'right', or both sides (None) | ||
the 'left', 'right', or both sides (None). | ||
**kwargs | ||
For compatibility. Has no effect on the result. | ||
|
||
Notes | ||
----- | ||
|
@@ -1528,7 +1531,16 @@ def bdate_range(start=None, end=None, periods=None, freq='B', tz=None, | |
|
||
Returns | ||
------- | ||
rng : DatetimeIndex | ||
DatetimeIndex | ||
|
||
Examples | ||
-------- | ||
Note how the two weekend days are skipped in the result. | ||
|
||
>>> pd.bdate_range(start='1/1/2018', end='1/08/2018') | ||
DatetimeIndex(['2018-01-01', '2018-01-02', '2018-01-03', '2018-01-04', | ||
'2018-01-05', '2018-01-08'], | ||
dtype='datetime64[ns]', freq='B') | ||
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. Hmmm...that output formatting of the lines is a little weird there. Should they be more aligned? |
||
""" | ||
if freq is None: | ||
msg = 'freq must be specified for bdate_range; use date_range instead' | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Not sure we need to document
**kwargs
?cc @WillAyd @datapythonista
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, we've been documenting them, even when we need to say that they don't have any effect. Explicit is better than implicit. :)