From 6b8fedd22c57854f461ce93d02c7b62bbf060cf8 Mon Sep 17 00:00:00 2001 From: alimcmaster1 Date: Mon, 13 Aug 2018 20:53:54 +0100 Subject: [PATCH 1/3] Remove outdated docs --- pandas/core/indexes/datetimes.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 019aad4941d26..9ebeffba751c5 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -1815,11 +1815,6 @@ def cdate_range(start=None, end=None, periods=None, freq='C', tz=None, Normalize start/end dates to midnight before generating date range name : string, default None Name of the resulting DatetimeIndex - weekmask : string, Default 'Mon Tue Wed Thu Fri' - weekmask of valid business days, passed to ``numpy.busdaycalendar`` - holidays : list - list/array of dates to exclude from the set of valid business days, - passed to ``numpy.busdaycalendar`` closed : string, default None Make the interval closed with respect to the given frequency to the 'left', 'right', or both sides (None) From 53bc14487379c760700f555606f45220c0ae7f4b Mon Sep 17 00:00:00 2001 From: alimcmaster1 Date: Mon, 13 Aug 2018 22:07:25 +0100 Subject: [PATCH 2/3] Remove deprecated method cdate_range --- doc/source/timeseries.rst | 9 +++--- pandas/core/indexes/datetimes.py | 54 -------------------------------- pandas/tests/api/test_api.py | 10 ------ 3 files changed, 5 insertions(+), 68 deletions(-) diff --git a/doc/source/timeseries.rst b/doc/source/timeseries.rst index b7771436f8e55..774003c23b298 100644 --- a/doc/source/timeseries.rst +++ b/doc/source/timeseries.rst @@ -426,10 +426,11 @@ Custom Frequency Ranges .. warning:: This functionality was originally exclusive to ``cdate_range``, which is - deprecated as of version 0.21.0 in favor of ``bdate_range``. Note that - ``cdate_range`` only utilizes the ``weekmask`` and ``holidays`` parameters - when custom business day, 'C', is passed as the frequency string. Support has - been expanded with ``bdate_range`` to work with any custom frequency string. + deprecated as of version 0.21.0 (deleted in 0.24.0) in favor of + ``bdate_range``. Note that ``cdate_range`` only utilizes the ``weekmask`` + and ``holidays`` parameters when custom business day, 'C', is passed + as the frequency string. Support has been expanded with ``bdate_range`` + to work with any custom frequency string. .. versionadded:: 0.21.0 diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 9ebeffba751c5..ca8c6514a08c2 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -1790,60 +1790,6 @@ def bdate_range(start=None, end=None, periods=None, freq='B', tz=None, closed=closed, **kwargs) -def cdate_range(start=None, end=None, periods=None, freq='C', tz=None, - normalize=True, name=None, closed=None, **kwargs): - """ - Return a fixed frequency DatetimeIndex, with CustomBusinessDay as the - default frequency - - .. deprecated:: 0.21.0 - - Parameters - ---------- - start : string or datetime-like, default None - Left bound for generating dates - end : string or datetime-like, default None - Right bound for generating dates - periods : integer, default None - Number of periods to generate - freq : string or DateOffset, default 'C' (CustomBusinessDay) - Frequency strings can have multiples, e.g. '5H' - tz : string, default None - Time zone name for returning localized DatetimeIndex, for example - Asia/Beijing - normalize : bool, default False - Normalize start/end dates to midnight before generating date range - name : string, default None - Name of the resulting DatetimeIndex - closed : string, default None - Make the interval closed with respect to the given frequency to - the 'left', 'right', or both sides (None) - - Notes - ----- - Of the three parameters: ``start``, ``end``, and ``periods``, exactly two - must be specified. - - To learn more about the frequency strings, please see `this link - `__. - - Returns - ------- - rng : DatetimeIndex - """ - warnings.warn("cdate_range is deprecated and will be removed in a future " - "version, instead use pd.bdate_range(..., freq='{freq}')" - .format(freq=freq), FutureWarning, stacklevel=2) - - if freq == 'C': - holidays = kwargs.pop('holidays', []) - weekmask = kwargs.pop('weekmask', 'Mon Tue Wed Thu Fri') - freq = CDay(holidays=holidays, weekmask=weekmask) - return DatetimeIndex(start=start, end=end, periods=periods, freq=freq, - tz=tz, normalize=normalize, name=name, - closed=closed, **kwargs) - - _CACHE_START = Timestamp(datetime(1950, 1, 1)) _CACHE_END = Timestamp(datetime(2030, 1, 1)) diff --git a/pandas/tests/api/test_api.py b/pandas/tests/api/test_api.py index bf9e14b427015..1bdce3c4139ad 100644 --- a/pandas/tests/api/test_api.py +++ b/pandas/tests/api/test_api.py @@ -215,16 +215,6 @@ def test_deprecation_access_func(self): ignore_order=True) -class TestCDateRange(object): - - def test_deprecation_cdaterange(self): - # GH17596 - from pandas.core.indexes.datetimes import cdate_range - with tm.assert_produces_warning(FutureWarning, - check_stacklevel=False): - cdate_range('2017-01-01', '2017-12-31') - - class TestCategoricalMove(object): def test_categorical_move(self): From 376e48cb3a492df584fd3b9653e25bb3a46d655b Mon Sep 17 00:00:00 2001 From: alimcmaster1 Date: Tue, 14 Aug 2018 00:39:10 +0100 Subject: [PATCH 3/3] Remove unrequired-doc --- doc/source/timeseries.rst | 9 --------- 1 file changed, 9 deletions(-) diff --git a/doc/source/timeseries.rst b/doc/source/timeseries.rst index 774003c23b298..1e982a59fc460 100644 --- a/doc/source/timeseries.rst +++ b/doc/source/timeseries.rst @@ -423,15 +423,6 @@ resulting ``DatetimeIndex``: Custom Frequency Ranges ~~~~~~~~~~~~~~~~~~~~~~~ -.. warning:: - - This functionality was originally exclusive to ``cdate_range``, which is - deprecated as of version 0.21.0 (deleted in 0.24.0) in favor of - ``bdate_range``. Note that ``cdate_range`` only utilizes the ``weekmask`` - and ``holidays`` parameters when custom business day, 'C', is passed - as the frequency string. Support has been expanded with ``bdate_range`` - to work with any custom frequency string. - .. versionadded:: 0.21.0 ``bdate_range`` can also generate a range of custom frequency dates by using