From 60d16df8b3f002455e2994252137d6f7ffab6748 Mon Sep 17 00:00:00 2001 From: tp Date: Fri, 20 Aug 2021 21:35:38 +0100 Subject: [PATCH] remove version numbers --- doc/source/user_guide/advanced.rst | 16 ++++++++-------- doc/source/whatsnew/v1.4.0.rst | 20 ++++++++++---------- pandas/__init__.py | 3 +++ 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/doc/source/user_guide/advanced.rst b/doc/source/user_guide/advanced.rst index e690c470c5437..2b9cf9d1765e8 100644 --- a/doc/source/user_guide/advanced.rst +++ b/doc/source/user_guide/advanced.rst @@ -854,9 +854,9 @@ Int64Index and RangeIndex .. deprecated:: 1.4.0 In pandas 2.0, :class:`NumericIndex` will become the default index type for numeric types instead of ``Int64Index``, ``Float64Index`` and ``UInt64Index`` and those index types - are therefore deprecated and will be removed in Pandas 2.0. + are therefore deprecated and will be removed in a futire version. See :ref:`here ` for more. - ``RangeIndex`` however, will not be removed, as it represents an optimized version of an integer index. + ``RangeIndex`` will not be removed, as it represents an optimized version of an integer index. :class:`Int64Index` is a fundamental basic index in pandas. This is an immutable array implementing an ordered, sliceable set. @@ -870,11 +870,11 @@ Float64Index ~~~~~~~~~~~~ .. deprecated:: 1.4.0 - In pandas 2.0, :class:`NumericIndex` will become the default index type for numeric types + :class:`NumericIndex` will become the default index type for numeric types in the future instead of ``Int64Index``, ``Float64Index`` and ``UInt64Index`` and those index types - are therefore deprecated and will be removed in Pandas 2.0. + are therefore deprecated and will be removed in a future version of Pandas. See :ref:`here ` for more. - ``RangeIndex`` however, will not be removed, as it represents an optimized version of an integer index. + ``RangeIndex`` will not be removed as it represents an optimized version of an integer index. By default a :class:`Float64Index` will be automatically created when passing floating, or mixed-integer-floating values in index creation. This enables a pure label-based slicing paradigm that makes ``[],ix,loc`` for scalar indexing and slicing work exactly the @@ -982,8 +982,8 @@ NumericIndex In pandas 2.0, :class:`NumericIndex` will become the default index type for numeric types instead of :class:`Int64Index`, :class:`Float64Index` and :class:`UInt64Index` and those index types - are therefore deprecated and will be removed in Pandas 2.0. - :class:`RangeIndex` however, will not be removed, as it represents an optimized version of an integer index. + are therefore deprecated and will be removed in a futureversion. + :class:`RangeIndex` will not be removed as it represents an optimized version of an integer index. :class:`NumericIndex` is an index type that can hold data of any numpy int/uint/float dtype. For example: @@ -998,7 +998,7 @@ NumericIndex ``UInt64Index`` except that it can hold any numpy int, uint or float dtype. Until Pandas 2.0, you will have to call ``NumericIndex`` explicitly in order to use it, like in the example above. -In Pandas 2.0, ``NumericIndex`` will become the default pandas numeric index type and will automatically be used where appropriate. +In the future, ``NumericIndex`` will become the default pandas numeric index type and will automatically be used where appropriate. Please notice that ``NumericIndex`` *can not* hold Pandas numeric dtypes (:class:`Int64Dtype`, :class:`Int32Dtype` etc.). diff --git a/doc/source/whatsnew/v1.4.0.rst b/doc/source/whatsnew/v1.4.0.rst index 4ea518c32cace..9f7b49d7c170d 100644 --- a/doc/source/whatsnew/v1.4.0.rst +++ b/doc/source/whatsnew/v1.4.0.rst @@ -29,8 +29,8 @@ It is now possible to create an index of any numpy int/uint/float dtype using th pd.NumericIndex([1, 2, 3], dtype="uint32") pd.NumericIndex([1, 2, 3], dtype="float32") -In order to maintain backwards compatibility, calls to the base :class:`Index` will in -pandas 1.x. return :class:`Int64Index`, :class:`UInt64Index` and :class:`Float64Index`, where relevant. +In order to maintain backwards compatibility, calls to the base :class:`Index` will currently +return :class:`Int64Index`, :class:`UInt64Index` and :class:`Float64Index`, where relevant. For example, the code below returns an ``Int64Index`` with dtype ``int64``: .. code-block:: ipython @@ -38,11 +38,11 @@ For example, the code below returns an ``Int64Index`` with dtype ``int64``: In [1]: pd.Index([1, 2, 3], dtype="int8") Int64Index([1, 2, 3], dtype='int64') -but will in Pandas 2.0 return a :class:`NumericIndex` with dtype ``int8``. +but will in a future version return a :class:`NumericIndex` with dtype ``int8``. -More generally, for the duration of Pandas 1.x, all operations that until now have +More generally, currently, all operations that until now have returned :class:`Int64Index`, :class:`UInt64Index` and :class:`Float64Index` will -continue to so. This means, that in order to use ``NumericIndex`` in Pandas 1.x, you +continue to so. This means, that in order to use ``NumericIndex`` in the current version, you will have to call ``NumericIndex`` explicitly. For example the below series will have an ``Int64Index``: .. code-block:: ipython @@ -51,7 +51,7 @@ will have to call ``NumericIndex`` explicitly. For example the below series will In [3]: ser.index Int64Index([1, 2, 3], dtype='int64') -Instead, if you want to use a ``NumericIndex`` in Pandas 1.x, you should do: +Instead, if you want to use a ``NumericIndex``, you should do: .. ipython:: python @@ -59,9 +59,9 @@ Instead, if you want to use a ``NumericIndex`` in Pandas 1.x, you should do: ser = pd.Series([1, 2, 3], index=idx) ser.index -In Pandas 2.0, :class:`NumericIndex` will become the default numeric index type and +In a future version of Pandas, :class:`NumericIndex` will become the default numeric index type and ``Int64Index``, ``UInt64Index`` and ``Float64Index`` are therefore deprecated and will -be removed in pandas 2.0, see :ref:`here ` for more. +be removed in the future, see :ref:`here ` for more. See :ref:`here ` for more about :class:`NumericIndex`. @@ -209,9 +209,9 @@ Deprecated Int64Index, UInt64Index & Float64Index :class:`Int64Index`, :class:`UInt64Index` and :class:`Float64Index` have been deprecated in favor of the new :class:`NumericIndex` and will be removed in Pandas 2.0 (:issue:`43028`). -For the duration of Pandas 1.x, in order to maintain backward compatibility, calls to +Currently, in order to maintain backward compatibility, calls to :class:`Index` will continue to return :class:`Int64Index`, :class:`UInt64Index` and :class:`Float64Index` -when given numeric data, but in Pandas 2.0, a :class:`NumericIndex` will be returned. +when given numeric data, but in the future, a :class:`NumericIndex` will be returned. *Current behavior*: diff --git a/pandas/__init__.py b/pandas/__init__.py index cd2611b6193cd..bd6213cf8d05c 100644 --- a/pandas/__init__.py +++ b/pandas/__init__.py @@ -187,6 +187,9 @@ def __dir__(): + # GH43028 + # Int64Index etc. are deprecated, but we still want them to be available in the dir. + # Remove in Pandas 2.0, when we remove Int64Index etc. from the code base. return list(globals().keys()) + __deprecated_num_index_names