From c28157873cecb7531652c4df6e1e2dae48e3f181 Mon Sep 17 00:00:00 2001 From: Patrick Hoefler Date: Mon, 18 Dec 2023 00:34:41 +0100 Subject: [PATCH] DOC: Remove 1.2 versionadded and changed --- pandas/_testing/asserters.py | 5 ---- pandas/core/arrays/floating.py | 2 -- pandas/core/arrays/string_arrow.py | 2 -- pandas/core/construction.py | 6 ----- pandas/core/flags.py | 2 -- pandas/core/frame.py | 15 ------------ pandas/core/generic.py | 37 ------------------------------ pandas/core/groupby/grouper.py | 2 -- pandas/core/indexes/base.py | 3 --- pandas/core/series.py | 2 -- pandas/core/window/rolling.py | 4 ---- pandas/errors/__init__.py | 2 -- pandas/io/common.py | 7 +----- pandas/io/excel/_base.py | 4 ---- pandas/io/feather_format.py | 5 ---- pandas/io/formats/excel.py | 1 - pandas/io/formats/format.py | 3 --- pandas/io/formats/style.py | 12 ---------- pandas/io/json/_json.py | 7 ------ pandas/io/parquet.py | 5 ---- pandas/io/parsers/readers.py | 24 ------------------- pandas/io/pickle.py | 4 ---- pandas/io/sas/sasreader.py | 8 ------- pandas/io/sql.py | 2 -- pandas/io/stata.py | 2 -- pandas/plotting/_core.py | 8 ------- 26 files changed, 1 insertion(+), 173 deletions(-) diff --git a/pandas/_testing/asserters.py b/pandas/_testing/asserters.py index d9db2bc5cddb4..e342f76dc724b 100644 --- a/pandas/_testing/asserters.py +++ b/pandas/_testing/asserters.py @@ -209,8 +209,6 @@ def assert_index_equal( Whether to compare the order of index entries as well as their values. If True, both indexes must contain the same elements, in the same order. If False, both indexes must contain the same elements, but in any order. - - .. versionadded:: 1.2.0 rtol : float, default 1e-5 Relative tolerance. Only used when check_exact is False. atol : float, default 1e-8 @@ -853,9 +851,6 @@ def assert_series_equal( Whether to check the `freq` attribute on a DatetimeIndex or TimedeltaIndex. check_flags : bool, default True Whether to check the `flags` attribute. - - .. versionadded:: 1.2.0 - rtol : float, default 1e-5 Relative tolerance. Only used when check_exact is False. atol : float, default 1e-8 diff --git a/pandas/core/arrays/floating.py b/pandas/core/arrays/floating.py index 40c8347c6f1a3..74b8cfb65cbc7 100644 --- a/pandas/core/arrays/floating.py +++ b/pandas/core/arrays/floating.py @@ -57,8 +57,6 @@ class FloatingArray(NumericArray): """ Array of floating (optional missing) values. - .. versionadded:: 1.2.0 - .. warning:: FloatingArray is currently experimental, and its API or internal diff --git a/pandas/core/arrays/string_arrow.py b/pandas/core/arrays/string_arrow.py index ebf5f2636bf12..32ab3054c0f51 100644 --- a/pandas/core/arrays/string_arrow.py +++ b/pandas/core/arrays/string_arrow.py @@ -82,8 +82,6 @@ class ArrowStringArray(ObjectStringArrayMixin, ArrowExtensionArray, BaseStringAr """ Extension array for string data in a ``pyarrow.ChunkedArray``. - .. versionadded:: 1.2.0 - .. warning:: ArrowStringArray is considered experimental. The implementation and diff --git a/pandas/core/construction.py b/pandas/core/construction.py index 12a0486853f15..d41a9c80a10ec 100644 --- a/pandas/core/construction.py +++ b/pandas/core/construction.py @@ -127,12 +127,6 @@ def array( ``pd.options.mode.string_storage`` if the dtype is not explicitly given. For all other cases, NumPy's usual inference rules will be used. - - .. versionchanged:: 1.2.0 - - Pandas now also infers nullable-floating dtype for float-like - input data - copy : bool, default True Whether to copy the data, even if not necessary. Depending on the type of `data`, creating the new array may require diff --git a/pandas/core/flags.py b/pandas/core/flags.py index 038132f99c82e..aff7a15f283ba 100644 --- a/pandas/core/flags.py +++ b/pandas/core/flags.py @@ -11,8 +11,6 @@ class Flags: """ Flags that apply to pandas objects. - .. versionadded:: 1.2.0 - Parameters ---------- obj : Series or DataFrame diff --git a/pandas/core/frame.py b/pandas/core/frame.py index b63929079abeb..0b66a2fa593bf 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -335,9 +335,6 @@ join; preserve the order of the left keys. * cross: creates the cartesian product from both frames, preserves the order of the left keys. - - .. versionadded:: 1.2.0 - on : label or list Column or index level names to join on. These must be found in both DataFrames. If `on` is None and not merging on indexes then this defaults @@ -2780,8 +2777,6 @@ def to_stata( {storage_options} - .. versionadded:: 1.2.0 - value_labels : dict of dicts Dictionary containing columns as keys and dictionaries of column value to labels as values. Labels for a single variable must be 32,000 @@ -2994,11 +2989,6 @@ def to_parquet( object implementing a binary ``write()`` function. If None, the result is returned as bytes. If a string or path, it will be used as Root Directory path when writing a partitioned dataset. - - .. versionchanged:: 1.2.0 - - Previously this was "fname" - engine : {{'auto', 'pyarrow', 'fastparquet'}}, default 'auto' Parquet library to use. If 'auto', then the option ``io.parquet.engine`` is used. The default ``io.parquet.engine`` @@ -3021,8 +3011,6 @@ def to_parquet( Must be None if path is not a string. {storage_options} - .. versionadded:: 1.2.0 - **kwargs Additional arguments passed to the parquet library. See :ref:`pandas io ` for more details. @@ -10564,9 +10552,6 @@ def join( of the calling's one. * cross: creates the cartesian product from both frames, preserves the order of the left keys. - - .. versionadded:: 1.2.0 - lsuffix : str, default '' Suffix to use from left frame's overlapping columns. rsuffix : str, default '' diff --git a/pandas/core/generic.py b/pandas/core/generic.py index e46a0aa044b6d..3ff66772c419f 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2522,8 +2522,6 @@ def to_json( {storage_options} - .. versionadded:: 1.2.0 - mode : str, default 'w' (writing) Specify the IO mode for output when supplying a path_or_buf. Accepted args are 'w' (writing) and 'a' (append) only. @@ -3128,8 +3126,6 @@ def to_pickle( {storage_options} - .. versionadded:: 1.2.0 - See Also -------- read_pickle : Load pickled pandas object (or any object) from file. @@ -3417,9 +3413,6 @@ def to_latex( into a main LaTeX document or read from an external file with ``\input{{table.tex}}``. - .. versionchanged:: 1.2.0 - Added position argument, changed meaning of caption argument. - .. versionchanged:: 2.0.0 Refactored to use the Styler implementation via jinja2 templating. @@ -3510,10 +3503,6 @@ def to_latex( Tuple (full_caption, short_caption), which results in ``\caption[short_caption]{{full_caption}}``; if a single string is passed, no short caption will be set. - - .. versionchanged:: 1.2.0 - Optionally allow caption to be a tuple ``(full_caption, short_caption)``. - label : str, optional The LaTeX label to be placed inside ``\label{{}}`` in the output. This is used with ``\ref{{}}`` in the main ``.tex`` file. @@ -3522,8 +3511,6 @@ def to_latex( The LaTeX positional argument for tables, to be placed after ``\begin{{}}`` in the output. - .. versionadded:: 1.2.0 - Returns ------- str or None @@ -3844,11 +3831,6 @@ def to_csv( returned as a string. If a non-binary file object is passed, it should be opened with `newline=''`, disabling universal newlines. If a binary file object is passed, `mode` might need to contain a `'b'`. - - .. versionchanged:: 1.2.0 - - Support for binary file objects was introduced. - sep : str, default ',' String of length 1. Field delimiter for the output file. na_rep : str, default '' @@ -3889,17 +3871,6 @@ def to_csv( Passing compression options as keys in dict is supported for compression modes 'gzip', 'bz2', 'zstd', and 'zip'. - - .. versionchanged:: 1.2.0 - - Compression is supported for binary file objects. - - .. versionchanged:: 1.2.0 - - Previous versions forwarded dict entries for 'gzip' to - `gzip.open` instead of `gzip.GzipFile` which prevented - setting `mtime`. - quoting : optional constant from csv module Defaults to csv.QUOTE_MINIMAL. If you have set a `float_format` then floats are converted to strings and thus csv.QUOTE_NONNUMERIC @@ -3935,8 +3906,6 @@ def to_csv( {storage_options} - .. versionadded:: 1.2.0 - Returns ------- None or str @@ -6941,8 +6910,6 @@ def convert_dtypes( Whether, if possible, conversion can be done to floating extension types. If `convert_integer` is also True, preference will be give to integer dtypes if the floats can be faithfully casted to integers. - - .. versionadded:: 1.2.0 dtype_backend : {'numpy_nullable', 'pyarrow'}, default 'numpy_nullable' Back-end data type applied to the resultant :class:`DataFrame` (still experimental). Behaviour is as follows: @@ -6986,10 +6953,6 @@ def convert_dtypes( appropriate integer extension type. Otherwise, convert to an appropriate floating extension type. - .. versionchanged:: 1.2 - Starting with pandas 1.2, this method also converts float columns - to the nullable floating extension type. - In the future, as new dtypes are added that support ``pd.NA``, the results of this method will change to support those new dtypes. diff --git a/pandas/core/groupby/grouper.py b/pandas/core/groupby/grouper.py index 4703c12db602d..e2224caad9e84 100644 --- a/pandas/core/groupby/grouper.py +++ b/pandas/core/groupby/grouper.py @@ -119,8 +119,6 @@ class Grouper: row/column will be dropped. If False, NA values will also be treated as the key in groups. - .. versionadded:: 1.2.0 - Returns ------- Grouper or pandas.api.typing.TimeGrouper diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 18d6834e6191c..8524e01d4255f 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -5814,9 +5814,6 @@ def sort_values( na_position : {'first' or 'last'}, default 'last' Argument 'first' puts NaNs at the beginning, 'last' puts NaNs at the end. - - .. versionadded:: 1.2.0 - key : callable, optional If not None, apply the key function to the index values before sorting. This is similar to the `key` argument in the diff --git a/pandas/core/series.py b/pandas/core/series.py index 626fcd47764e7..a9d4438c5c56b 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -1920,8 +1920,6 @@ def to_markdown( {storage_options} - .. versionadded:: 1.2.0 - **kwargs These parameters will be passed to `tabulate \ `_. diff --git a/pandas/core/window/rolling.py b/pandas/core/window/rolling.py index f268d36d7fdc4..e78bd258c11ff 100644 --- a/pandas/core/window/rolling.py +++ b/pandas/core/window/rolling.py @@ -957,10 +957,6 @@ class Window(BaseWindow): Default ``None`` (``'right'``). - .. versionchanged:: 1.2.0 - - The closed parameter with fixed windows is now supported. - step : int, default None .. versionadded:: 1.5.0 diff --git a/pandas/errors/__init__.py b/pandas/errors/__init__.py index f33144be34da2..01094ba36b9dd 100644 --- a/pandas/errors/__init__.py +++ b/pandas/errors/__init__.py @@ -329,8 +329,6 @@ class DuplicateLabelError(ValueError): """ Error raised when an operation would introduce duplicate labels. - .. versionadded:: 1.2.0 - Examples -------- >>> s = pd.Series([0, 1, 2], index=['a', 'b', 'c']).set_flags( diff --git a/pandas/io/common.py b/pandas/io/common.py index d08612f4f09f6..72c9deeb54fc7 100644 --- a/pandas/io/common.py +++ b/pandas/io/common.py @@ -329,11 +329,8 @@ def _get_filepath_or_buffer( {storage_options} - .. versionadded:: 1.2.0 - ..versionchange:: 1.2.0 - - Returns the dataclass IOArgs. + Returns the dataclass IOArgs. """ filepath_or_buffer = stringify_path(filepath_or_buffer) @@ -711,8 +708,6 @@ def get_handle( storage_options: StorageOptions = None Passed to _get_filepath_or_buffer - .. versionchanged:: 1.2.0 - Returns the dataclass IOHandles """ # Windows does not default to utf-8. Set to utf-8 for a consistent behavior diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 2884294377ec9..bce890c6f73b0 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -292,8 +292,6 @@ Rows at the end to skip (0-indexed). {storage_options} - .. versionadded:: 1.2.0 - dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' Back-end data type applied to the resultant :class:`DataFrame` (still experimental). Behaviour is as follows: @@ -971,8 +969,6 @@ class ExcelWriter(Generic[_WorkbookT]): File mode to use (write or append). Append does not work with fsspec URLs. {storage_options} - .. versionadded:: 1.2.0 - if_sheet_exists : {{'error', 'new', 'replace', 'overlay'}}, default 'error' How to behave when trying to write to a sheet that already exists (append mode only). diff --git a/pandas/io/feather_format.py b/pandas/io/feather_format.py index c451cd6c139ed..d0aaf83b84cb2 100644 --- a/pandas/io/feather_format.py +++ b/pandas/io/feather_format.py @@ -50,9 +50,6 @@ def to_feather( df : DataFrame path : str, path object, or file-like object {storage_options} - - .. versionadded:: 1.2.0 - **kwargs : Additional keywords passed to `pyarrow.feather.write_feather`. @@ -93,8 +90,6 @@ def read_feather( Whether to parallelize reading using multiple threads. {storage_options} - .. versionadded:: 1.2.0 - dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' Back-end data type applied to the resultant :class:`DataFrame` (still experimental). Behaviour is as follows: diff --git a/pandas/io/formats/excel.py b/pandas/io/formats/excel.py index 684cd4340cd2b..5fd23cd7d918a 100644 --- a/pandas/io/formats/excel.py +++ b/pandas/io/formats/excel.py @@ -921,7 +921,6 @@ def write( {storage_options} - .. versionadded:: 1.2.0 engine_kwargs: dict, optional Arbitrary keyword arguments passed to excel engine. """ diff --git a/pandas/io/formats/format.py b/pandas/io/formats/format.py index cc83e51fb2bd6..445d60be1dc15 100644 --- a/pandas/io/formats/format.py +++ b/pandas/io/formats/format.py @@ -132,9 +132,6 @@ floats. This function must return a unicode string and will be applied only to the non-``NaN`` elements, with ``NaN`` being handled by ``na_rep``. - - .. versionchanged:: 1.2.0 - sparsify : bool, optional, default True Set to False for a DataFrame with a hierarchical index to print every multiindex key at each row. diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 7d5c354aef002..b62f7581ac220 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -161,9 +161,6 @@ class Styler(StylerRenderer): uuid_len : int, default 5 If ``uuid`` is not specified, the length of the ``uuid`` to randomly generate expressed in hex characters, in range [0, 32]. - - .. versionadded:: 1.2.0 - decimal : str, optional Character used as decimal separator for floats, complex and integers. If not given uses ``pandas.options.styler.format.decimal``. @@ -2517,23 +2514,14 @@ def set_table_styles( in their respective tuple form. The dict values should be a list as specified in the form with CSS selectors and props that will be applied to the specified row or column. - - .. versionchanged:: 1.2.0 - axis : {0 or 'index', 1 or 'columns', None}, default 0 Apply to each column (``axis=0`` or ``'index'``), to each row (``axis=1`` or ``'columns'``). Only used if `table_styles` is dict. - - .. versionadded:: 1.2.0 - overwrite : bool, default True Styles are replaced if `True`, or extended if `False`. CSS rules are preserved so most recent styles set will dominate if selectors intersect. - - .. versionadded:: 1.2.0 - css_class_names : dict, optional A dict of strings used to replace the default CSS classes described below. diff --git a/pandas/io/json/_json.py b/pandas/io/json/_json.py index 9c56089560507..b8fba4d173ae7 100644 --- a/pandas/io/json/_json.py +++ b/pandas/io/json/_json.py @@ -648,11 +648,6 @@ def read_json( for more information on ``chunksize``. This can only be passed if `lines=True`. If this is None, the file will be read into memory all at once. - - .. versionchanged:: 1.2 - - ``JsonReader`` is a context manager. - {decompression_options} .. versionchanged:: 1.4.0 Zstandard support. @@ -664,8 +659,6 @@ def read_json( {storage_options} - .. versionadded:: 1.2.0 - dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' Back-end data type applied to the resultant :class:`DataFrame` (still experimental). Behaviour is as follows: diff --git a/pandas/io/parquet.py b/pandas/io/parquet.py index 0785f14c6839d..295eb3cbdd500 100644 --- a/pandas/io/parquet.py +++ b/pandas/io/parquet.py @@ -429,9 +429,6 @@ def to_parquet( returned as bytes. If a string, it will be used as Root Directory path when writing a partitioned dataset. The engine fastparquet does not accept file-like objects. - - .. versionchanged:: 1.2.0 - engine : {{'auto', 'pyarrow', 'fastparquet'}}, default 'auto' Parquet library to use. If 'auto', then the option ``io.parquet.engine`` is used. The default ``io.parquet.engine`` @@ -460,8 +457,6 @@ def to_parquet( Must be None if path is not a string. {storage_options} - .. versionadded:: 1.2.0 - filesystem : fsspec or pyarrow filesystem, default None Filesystem object to use when reading the parquet file. Only implemented for ``engine="pyarrow"``. diff --git a/pandas/io/parsers/readers.py b/pandas/io/parsers/readers.py index 2f9243c895ae8..7326ad831ee96 100644 --- a/pandas/io/parsers/readers.py +++ b/pandas/io/parsers/readers.py @@ -312,10 +312,6 @@ iterator : bool, default False Return ``TextFileReader`` object for iteration or getting chunks with ``get_chunk()``. - - .. versionchanged:: 1.2 - - ``TextFileReader`` is a context manager. chunksize : int, optional Number of lines to read from the file per chunk. Passing a value will cause the function to return a ``TextFileReader`` object for iteration. @@ -323,9 +319,6 @@ `_ for more information on ``iterator`` and ``chunksize``. - .. versionchanged:: 1.2 - - ``TextFileReader`` is a context manager. {decompression_options} .. versionchanged:: 1.4.0 Zstandard support. @@ -365,17 +358,6 @@ standard encodings `_ . - .. versionchanged:: 1.2 - - When ``encoding`` is ``None``, ``errors='replace'`` is passed to - ``open()``. Otherwise, ``errors='strict'`` is passed to ``open()``. - This behavior was previously only the case for ``engine='python'``. - - .. versionchanged:: 1.3.0 - - ``encoding_errors`` is a new argument. ``encoding`` has no longer an - influence on how encoding errors are handled. - encoding_errors : str, optional, default 'strict' How encoding errors are treated. `List of possible values `_ . @@ -437,12 +419,8 @@ ``'legacy'`` for the original lower precision pandas converter, and ``'round_trip'`` for the round-trip converter. - .. versionchanged:: 1.2 - {storage_options} - .. versionadded:: 1.2 - dtype_backend : {{'numpy_nullable', 'pyarrow'}}, default 'numpy_nullable' Back-end data type applied to the resultant :class:`DataFrame` (still experimental). Behaviour is as follows: @@ -1964,8 +1942,6 @@ def TextParser(*args, **kwds) -> TextFileReader: values. The options are `None` or `high` for the ordinary converter, `legacy` for the original lower precision pandas converter, and `round_trip` for the round-trip converter. - - .. versionchanged:: 1.2 """ kwds["engine"] = "python" return TextFileReader(*args, **kwds) diff --git a/pandas/io/pickle.py b/pandas/io/pickle.py index de9f1168e40dd..0dae0e7106b69 100644 --- a/pandas/io/pickle.py +++ b/pandas/io/pickle.py @@ -67,8 +67,6 @@ def to_pickle( {storage_options} - .. versionadded:: 1.2.0 - .. [1] https://docs.python.org/3/library/pickle.html See Also @@ -143,8 +141,6 @@ def read_pickle( {storage_options} - .. versionadded:: 1.2.0 - Returns ------- same type as object stored in file diff --git a/pandas/io/sas/sasreader.py b/pandas/io/sas/sasreader.py index 60b48bed8e124..c39313d5dc654 100644 --- a/pandas/io/sas/sasreader.py +++ b/pandas/io/sas/sasreader.py @@ -116,16 +116,8 @@ def read_sas( Encoding for text data. If None, text data are stored as raw bytes. chunksize : int Read file `chunksize` lines at a time, returns iterator. - - .. versionchanged:: 1.2 - - ``TextFileReader`` is a context manager. iterator : bool, defaults to False If True, returns an iterator for reading the file incrementally. - - .. versionchanged:: 1.2 - - ``TextFileReader`` is a context manager. {decompression_options} Returns diff --git a/pandas/io/sql.py b/pandas/io/sql.py index a83c2bf241450..12118d1488932 100644 --- a/pandas/io/sql.py +++ b/pandas/io/sql.py @@ -2912,8 +2912,6 @@ def get_schema( be a SQLAlchemy type, or a string for sqlite3 fallback connection. schema: str, default: None Optional specifying the schema to be used in creating the table. - - .. versionadded:: 1.2.0 """ with pandasSQL_builder(con=con) as pandas_sql: return pandas_sql._create_sql_schema( diff --git a/pandas/io/stata.py b/pandas/io/stata.py index 52c664a5c8a37..d1484510b654f 100644 --- a/pandas/io/stata.py +++ b/pandas/io/stata.py @@ -2283,8 +2283,6 @@ class StataWriter(StataParser): {storage_options} - .. versionadded:: 1.2.0 - value_labels : dict of dicts Dictionary containing columns as keys and dictionaries of column value to labels as values. The combined length of all labels for a single diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index bd04e812e0be1..1355bda9025b9 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -725,10 +725,6 @@ class PlotAccessor(PandasObject): Name to use for the xlabel on x-axis. Default uses index name as xlabel, or the x-column name for planar plots. - .. versionchanged:: 1.2.0 - - Now applicable to planar plots (`scatter`, `hexbin`). - .. versionchanged:: 2.0.0 Now applicable to histograms. @@ -737,10 +733,6 @@ class PlotAccessor(PandasObject): Name to use for the ylabel on y-axis. Default will show no ylabel, or the y-column name for planar plots. - .. versionchanged:: 1.2.0 - - Now applicable to planar plots (`scatter`, `hexbin`). - .. versionchanged:: 2.0.0 Now applicable to histograms.