Skip to content

Commit

Permalink
DOC: Updated docstrings related to DateTimeIndex. GH22459 (pandas-dev…
Browse files Browse the repository at this point in the history
  • Loading branch information
eldritchideen authored and JustinZhengBC committed Nov 14, 2018
1 parent cb51a02 commit ae938fd
Showing 1 changed file with 24 additions and 12 deletions.
36 changes: 24 additions & 12 deletions pandas/core/indexes/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1420,7 +1420,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**
Expand Down Expand Up @@ -1491,37 +1492,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
-----
Expand All @@ -1535,7 +1538,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')
"""
if freq is None:
msg = 'freq must be specified for bdate_range; use date_range instead'
Expand Down

0 comments on commit ae938fd

Please sign in to comment.