Skip to content

Commit f6f5ce5

Browse files
GuessWhoSamFoojorisvandenbossche
authored andcommitted
DOC: Update Sphinx Deprecated Directive (#16512)
1 parent 1265c27 commit f6f5ce5

File tree

16 files changed

+122
-77
lines changed

16 files changed

+122
-77
lines changed

doc/source/io.rst

+22-7
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,10 @@ usecols : array-like or callable, default ``None``
137137
138138
Using this parameter results in much faster parsing time and lower memory usage.
139139
as_recarray : boolean, default ``False``
140-
DEPRECATED: this argument will be removed in a future version. Please call
141-
``pd.read_csv(...).to_records()`` instead.
140+
141+
.. deprecated:: 0.18.2
142+
143+
Please call ``pd.read_csv(...).to_records()`` instead.
142144

143145
Return a NumPy recarray instead of a DataFrame after parsing the data. If
144146
set to ``True``, this option takes precedence over the ``squeeze`` parameter.
@@ -191,7 +193,11 @@ skiprows : list-like or integer, default ``None``
191193
skipfooter : int, default ``0``
192194
Number of lines at bottom of file to skip (unsupported with engine='c').
193195
skip_footer : int, default ``0``
194-
DEPRECATED: use the ``skipfooter`` parameter instead, as they are identical
196+
197+
.. deprecated:: 0.19.0
198+
199+
Use the ``skipfooter`` parameter instead, as they are identical
200+
195201
nrows : int, default ``None``
196202
Number of rows of file to read. Useful for reading pieces of large files.
197203
low_memory : boolean, default ``True``
@@ -202,16 +208,25 @@ low_memory : boolean, default ``True``
202208
use the ``chunksize`` or ``iterator`` parameter to return the data in chunks.
203209
(Only valid with C parser)
204210
buffer_lines : int, default None
205-
DEPRECATED: this argument will be removed in a future version because its
206-
value is not respected by the parser
211+
212+
.. deprecated:: 0.19.0
213+
214+
Argument removed because its value is not respected by the parser
215+
207216
compact_ints : boolean, default False
208-
DEPRECATED: this argument will be removed in a future version
217+
218+
.. deprecated:: 0.19.0
219+
220+
Argument moved to ``pd.to_numeric``
209221

210222
If ``compact_ints`` is ``True``, then for any column that is of integer dtype, the
211223
parser will attempt to cast it as the smallest integer ``dtype`` possible, either
212224
signed or unsigned depending on the specification from the ``use_unsigned`` parameter.
213225
use_unsigned : boolean, default False
214-
DEPRECATED: this argument will be removed in a future version
226+
227+
.. deprecated:: 0.18.2
228+
229+
Argument moved to ``pd.to_numeric``
215230

216231
If integer columns are being compacted (i.e. ``compact_ints=True``), specify whether
217232
the column should be compacted to the smallest signed or unsigned integer dtype.

doc/sphinxext/numpydoc/README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ The following options can be set in conf.py:
4646
methods and attributes. If a table of contents is made, Sphinx expects
4747
each entry to have a separate page.
4848

49-
- numpydoc_edit_link: bool (DEPRECATED -- edit your HTML template instead)
49+
- numpydoc_edit_link: bool (DEPRECATED -- edit your HTML template instead)
5050

5151
Whether to insert an edit link after docstrings.

pandas/core/categorical.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -398,8 +398,8 @@ def itemsize(self):
398398

399399
def reshape(self, new_shape, *args, **kwargs):
400400
"""
401-
DEPRECATED: calling this method will raise an error in a
402-
future release.
401+
.. deprecated:: 0.19.0
402+
Calling this method will raise an error in a future release.
403403
404404
An ndarray-compatible method that returns `self` because
405405
`Categorical` instances cannot actually be reshaped.
@@ -430,7 +430,8 @@ def base(self):
430430
@classmethod
431431
def from_array(cls, data, **kwargs):
432432
"""
433-
DEPRECATED: Use ``Categorical`` instead.
433+
.. deprecated:: 0.19.0
434+
Use ``Categorical`` instead.
434435
435436
Make a Categorical type from a single array-like object.
436437

pandas/core/common.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,8 @@ def in_qtconsole():
555555
"""
556556
check if we're inside an IPython qtconsole
557557
558-
DEPRECATED: This is no longer needed, or working, in IPython 3 and above.
558+
.. deprecated:: 0.14.1
559+
This is no longer needed, or working, in IPython 3 and above.
559560
"""
560561
try:
561562
ip = get_ipython() # noqa
@@ -573,8 +574,8 @@ def in_ipnb():
573574
"""
574575
check if we're inside an IPython Notebook
575576
576-
DEPRECATED: This is no longer used in pandas, and won't work in IPython 3
577-
and above.
577+
.. deprecated:: 0.14.1
578+
This is no longer needed, or working, in IPython 3 and above.
578579
"""
579580
try:
580581
ip = get_ipython() # noqa

pandas/core/generic.py

+9-7
Original file line numberDiff line numberDiff line change
@@ -1338,9 +1338,9 @@ def to_sql(self, name, con, flavor=None, schema=None, if_exists='fail',
13381338
Using SQLAlchemy makes it possible to use any DB supported by that
13391339
library. If a DBAPI2 object, only sqlite3 is supported.
13401340
flavor : 'sqlite', default None
1341-
DEPRECATED: this parameter will be removed in a future version,
1342-
as 'sqlite' is the only supported option if SQLAlchemy is not
1343-
installed.
1341+
.. deprecated:: 0.19.0
1342+
'sqlite' is the only supported option if SQLAlchemy is not
1343+
used.
13441344
schema : string, default None
13451345
Specify the schema (if database flavor supports this). If None, use
13461346
default schema.
@@ -3498,7 +3498,9 @@ def astype(self, dtype, copy=True, errors='raise', **kwargs):
34983498
34993499
.. versionadded:: 0.20.0
35003500
3501-
raise_on_error : DEPRECATED use ``errors`` instead
3501+
raise_on_error : raise on invalid input
3502+
.. deprecated:: 0.20.0
3503+
Use ``errors`` instead
35023504
kwargs : keyword arguments to pass on to the constructor
35033505
35043506
Returns
@@ -3602,7 +3604,6 @@ def convert_objects(self, convert_dates=True, convert_numeric=False,
36023604
convert_timedeltas=True, copy=True):
36033605
"""
36043606
Deprecated.
3605-
36063607
Attempt to infer better dtype for object columns
36073608
36083609
Parameters
@@ -5809,8 +5810,9 @@ def tz_localize(self, tz, axis=0, level=None, copy=True,
58095810
- 'NaT' will return NaT where there are ambiguous times
58105811
- 'raise' will raise an AmbiguousTimeError if there are ambiguous
58115812
times
5812-
infer_dst : boolean, default False (DEPRECATED)
5813-
Attempt to infer fall dst-transition hours based on order
5813+
infer_dst : boolean, default False
5814+
.. deprecated:: 0.15.0
5815+
Attempt to infer fall dst-transition hours based on order
58145816
58155817
Returns
58165818
-------

pandas/core/indexes/datetimes.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,9 @@ class DatetimeIndex(DatelikeOps, TimelikeOps, DatetimeIndexOpsMixin,
197197
times)
198198
- 'NaT' will return NaT where there are ambiguous times
199199
- 'raise' will raise an AmbiguousTimeError if there are ambiguous times
200-
infer_dst : boolean, default False (DEPRECATED)
201-
Attempt to infer fall dst-transition hours based on order
200+
infer_dst : boolean, default False
201+
.. deprecated:: 0.15.0
202+
Attempt to infer fall dst-transition hours based on order
202203
name : object
203204
Name to be stored in the index
204205
@@ -1818,8 +1819,9 @@ def tz_localize(self, tz, ambiguous='raise', errors='raise'):
18181819
18191820
.. versionadded:: 0.19.0
18201821
1821-
infer_dst : boolean, default False (DEPRECATED)
1822-
Attempt to infer fall dst-transition hours based on order
1822+
infer_dst : boolean, default False
1823+
.. deprecated:: 0.15.0
1824+
Attempt to infer fall dst-transition hours based on order
18231825
18241826
Returns
18251827
-------

pandas/core/indexes/period.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ def asfreq(self, freq=None, how='E'):
558558

559559
def to_datetime(self, dayfirst=False):
560560
"""
561-
DEPRECATED: use :meth:`to_timestamp` instead.
561+
.. deprecated:: 0.19.0
562+
Use :meth:`to_timestamp` instead.
562563
563564
Cast to DatetimeIndex.
564565
"""

pandas/core/panel4d.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
having 4 named dimensions. It is intended as a test bed for more
2020
N-Dimensional named containers.
2121
22-
DEPRECATED. Panel4D is deprecated and will be removed in a future version.
23-
The recommended way to represent these types of n-dimensional data are with
24-
the `xarray package <http://xarray.pydata.org/en/stable/>`__.
25-
Pandas provides a `.to_xarray()` method to automate this conversion.
22+
.. deprecated:: 0.19.0
23+
The recommended way to represent these types of n-dimensional data
24+
are with the `xarray package <http://xarray.pydata.org/en/stable/>`__.
25+
Pandas provides a `.to_xarray()` method to automate this conversion.
2626
2727
Parameters
2828
----------

pandas/core/panelnd.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ def create_nd_panel_factory(klass_name, orders, slices, slicer, aliases=None,
99
stat_axis=2, info_axis=0, ns=None):
1010
""" manufacture a n-d class:
1111
12-
DEPRECATED. Panelnd is deprecated and will be removed in a future version.
13-
The recommended way to represent these types of n-dimensional data are with
14-
the `xarray package <http://xarray.pydata.org/en/stable/>`__.
15-
Pandas provides a `.to_xarray()` method to automate this conversion.
12+
.. deprecated:: 0.19.0
13+
The recommended way to represent these types of n-dimensional data
14+
are with the `xarray package <http://xarray.pydata.org/en/stable/>`__.
15+
Pandas provides a `.to_xarray()` method to automate this conversion.
1616
1717
Parameters
1818
----------

pandas/core/series.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -850,8 +850,9 @@ def repeat(self, repeats, *args, **kwargs):
850850

851851
def reshape(self, *args, **kwargs):
852852
"""
853-
DEPRECATED: calling this method will raise an error in a
854-
future release. Please call ``.values.reshape(...)`` instead.
853+
.. deprecated:: 0.19.0
854+
Calling this method will raise an error. Please call
855+
``.values.reshape(...)`` instead.
855856
856857
return an ndarray with the values shape
857858
if the specified shape matches exactly the current shape, then

pandas/core/sparse/array.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,8 @@ def to_dense(self, fill=None):
391391
Parameters
392392
----------
393393
fill: float, default None
394-
DEPRECATED: this argument will be removed in a future version
395-
because it is not respected by this function.
394+
.. deprecated:: 0.20.0
395+
This argument is not respected by this function.
396396
397397
Returns
398398
-------

pandas/core/strings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ def str_match(arr, pat, case=True, flags=0, na=np.nan, as_indexer=None):
478478
flags : int, default 0 (no flags)
479479
re module flags, e.g. re.IGNORECASE
480480
na : default NaN, fill value for missing values.
481-
as_indexer : DEPRECATED
481+
as_indexer : DEPRECATED - Keyword is ignored.
482482
483483
Returns
484484
-------

pandas/core/window.py

+36-25
Original file line numberDiff line numberDiff line change
@@ -342,21 +342,23 @@ def aggregate(self, arg, *args, **kwargs):
342342
343343
Parameters
344344
----------
345-
how : string, default None (DEPRECATED)
346-
Method for down- or re-sampling""")
345+
how : string, default None
346+
.. deprecated:: 0.18.0
347+
Method for down- or re-sampling""")
347348

348349
_shared_docs['mean'] = dedent("""
349350
%(name)s mean
350351
351352
Parameters
352353
----------
353-
how : string, default None (DEPRECATED)
354-
Method for down- or re-sampling""")
354+
how : string, default None
355+
.. deprecated:: 0.18.0
356+
Method for down- or re-sampling""")
355357

356358

357359
class Window(_Window):
358360
"""
359-
Provides rolling window calculcations.
361+
Provides rolling window calculations.
360362
361363
.. versionadded:: 0.18.0
362364
@@ -374,9 +376,10 @@ class Window(_Window):
374376
Minimum number of observations in window required to have a value
375377
(otherwise result is NA). For a window that is specified by an offset,
376378
this will default to 1.
377-
freq : string or DateOffset object, optional (default None) (DEPRECATED)
378-
Frequency to conform the data to before computing the statistic.
379-
Specified as a frequency string or DateOffset object.
379+
freq : string or DateOffset object, optional (default None)
380+
.. deprecated:: 0.18.0
381+
Frequency to conform the data to before computing the statistic.
382+
Specified as a frequency string or DateOffset object.
380383
center : boolean, default False
381384
Set the labels at the center of the window.
382385
win_type : string, default None
@@ -571,8 +574,9 @@ def _apply_window(self, mean=True, how=None, **kwargs):
571574
----------
572575
mean : boolean, default True
573576
If True computes weighted mean, else weighted sum
574-
how : string, default to None (DEPRECATED)
575-
how to resample
577+
how : string, default to None
578+
.. deprecated:: 0.18.0
579+
how to resample
576580
577581
Returns
578582
-------
@@ -736,8 +740,9 @@ def _apply(self, func, name=None, window=None, center=None,
736740
window : int/array, default to _get_window()
737741
center : boolean, default to self.center
738742
check_minp : function, default to _use_window
739-
how : string, default to None (DEPRECATED)
740-
how to resample
743+
how : string, default to None
744+
.. deprecated:: 0.18.0
745+
how to resample
741746
742747
Returns
743748
-------
@@ -864,8 +869,9 @@ def sum(self, *args, **kwargs):
864869
865870
Parameters
866871
----------
867-
how : string, default 'max' (DEPRECATED)
868-
Method for down- or re-sampling""")
872+
how : string, default 'max'
873+
.. deprecated:: 0.18.0
874+
Method for down- or re-sampling""")
869875

870876
def max(self, how=None, *args, **kwargs):
871877
nv.validate_window_func('max', args, kwargs)
@@ -878,8 +884,9 @@ def max(self, how=None, *args, **kwargs):
878884
879885
Parameters
880886
----------
881-
how : string, default 'min' (DEPRECATED)
882-
Method for down- or re-sampling""")
887+
how : string, default 'min'
888+
.. deprecated:: 0.18.0
889+
Method for down- or re-sampling""")
883890

884891
def min(self, how=None, *args, **kwargs):
885892
nv.validate_window_func('min', args, kwargs)
@@ -896,8 +903,9 @@ def mean(self, *args, **kwargs):
896903
897904
Parameters
898905
----------
899-
how : string, default 'median' (DEPRECATED)
900-
Method for down- or re-sampling""")
906+
how : string, default 'median'
907+
.. deprecated:: 0.18.0
908+
Method for down- or re-sampling""")
901909

902910
def median(self, how=None, **kwargs):
903911
if self.freq is not None and how is None:
@@ -1329,9 +1337,10 @@ class Expanding(_Rolling_and_Expanding):
13291337
min_periods : int, default None
13301338
Minimum number of observations in window required to have a value
13311339
(otherwise result is NA).
1332-
freq : string or DateOffset object, optional (default None) (DEPRECATED)
1333-
Frequency to conform the data to before computing the statistic.
1334-
Specified as a frequency string or DateOffset object.
1340+
freq : string or DateOffset object, optional (default None)
1341+
.. deprecated:: 0.18.0
1342+
Frequency to conform the data to before computing the statistic.
1343+
Specified as a frequency string or DateOffset object.
13351344
center : boolean, default False
13361345
Set the labels at the center of the window.
13371346
axis : int or string, default 0
@@ -1593,8 +1602,9 @@ class EWM(_Rolling):
15931602
min_periods : int, default 0
15941603
Minimum number of observations in window required to have a value
15951604
(otherwise result is NA).
1596-
freq : None or string alias / date offset object, default=None (DEPRECATED)
1597-
Frequency to conform to before computing statistic
1605+
freq : None or string alias / date offset object, default=None
1606+
.. deprecated:: 0.18.0
1607+
Frequency to conform to before computing statistic
15981608
adjust : boolean, default True
15991609
Divide by decaying adjustment factor in beginning periods to account
16001610
for imbalance in relative weightings (viewing EWMA as a moving average)
@@ -1727,8 +1737,9 @@ def _apply(self, func, how=None, **kwargs):
17271737
Parameters
17281738
----------
17291739
func : string/callable to apply
1730-
how : string, default to None (DEPRECATED)
1731-
how to resample
1740+
how : string, default to None
1741+
.. deprecated:: 0.18.0
1742+
how to resample
17321743
17331744
Returns
17341745
-------

0 commit comments

Comments
 (0)