@@ -30,18 +30,20 @@ It is now possible to create an index of any numpy int/uint/float dtype using th
3030 pd.NumericIndex([1 , 2 , 3 ], dtype = " float32" )
3131
3232 In order to maintain backwards compatibility, calls to the base :class: `Index ` will in
33- pandas 1.x. return :class: `Int64Index `, :class: `UInt64Index ` and :class: `Float64Index `.
33+ pandas 1.x. return :class: `Int64Index `, :class: `UInt64Index ` and :class: `Float64Index `, where relevant .
3434For example, the code below returns an ``Int64Index `` with dtype ``int64 ``:
3535
3636.. code-block :: ipython
3737
3838 In [1]: pd.Index([1, 2, 3], dtype="int8")
3939 Int64Index([1, 2, 3], dtype='int64')
4040
41+ but will in Pandas 2.0 return a :class: `NumericIndex ` with dtype ``int8 ``.
42+
4143More generally, for the duration of Pandas 1.x, all operations that until now have
4244returned :class: `Int64Index `, :class: `UInt64Index ` and :class: `Float64Index ` will
43- continue to so. This means, that in order to use ``NumericIndex ``, you will have to call
44- ``NumericIndex `` explicitly. For example the below series will have an ``Int64Index ``:
45+ continue to so. This means, that in order to use ``NumericIndex `` in Pandas 1.x, you
46+ will have to call ``NumericIndex `` explicitly. For example the below series will have an ``Int64Index ``:
4547
4648.. code-block :: ipython
4749
@@ -59,9 +61,9 @@ Instead, if you want to use a ``NumericIndex`` in Pandas 1.x, you should do:
5961
6062 In Pandas 2.0, :class: `NumericIndex ` will become the default numeric index type and
6163``Int64Index ``, ``UInt64Index `` and ``Float64Index `` are therefore deprecated and will
62- be removed in pandas 2.0.
64+ be removed in pandas 2.0, see :ref: ` here < whatsnew_140.deprecations.int64_uint64_float64index >` for more .
6365
64- See :ref: `here <advanced.numericindex >` for more.
66+ See :ref: `here <advanced.numericindex >` for more about :class: ` NumericIndex ` .
6567
6668.. _whatsnew_140.enhancements.enhancement2 :
6769
@@ -199,9 +201,41 @@ Other API changes
199201
200202Deprecations
201203~~~~~~~~~~~~
202- - Deprecated :class: `Int64Index ` (:issue: `43028 `).
203- - Deprecated :class: `UInt64Index ` (:issue: `43028 `).
204- - Deprecated :class: `Float64Index ` (:issue: `43028 `).
204+
205+ .. _whatsnew_140.deprecations.int64_uint64_float64index :
206+
207+ Deprecated Int64Index, UInt64Index & Float64Index
208+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
209+ :class: `Int64Index `, :class: `UInt64Index ` (:issue: `43028 `) and :class: `Float64Index ` have
210+ been deprecated in favor of the new :class: `NumericIndex ` (:issue: `43028 `).
211+
212+ For the duration of Pandas 1.x, in order to maintain backward compatibility, calls to
213+ :class: `Index ` will continue to return :class: `Int64Index `, :class: `UInt64Index ` and :class: `Float64Index `
214+ when given numeric data, but in Pandas 2.0, a :class: `NumericIndex ` will be returned.
215+
216+ *Current behavior (Pandas 1.x) *:
217+
218+ .. code-block :: ipython
219+
220+ In [1]: pd.Index([1, 2, 3], dtype="int32")
221+ Out [1]: Int64Index([1, 2, 3], dtype='int64')
222+ In [1]: pd.Index([1, 2, 3], dtype="uint64")
223+ Out [1]: UInt64Index([1, 2, 3], dtype='uint64')
224+
225+ *Future behavior (Pandas 2.0) *:
226+
227+ .. code-block :: ipython
228+
229+ In [3]: pd.Index([1, 2, 3], dtype="int32")
230+ Out [3]: NumericIndex([1, 2, 3], dtype='int32')
231+ In [4]: pd.Index([1, 2, 3], dtype="uint64")
232+ Out [4]: NumericIndex([1, 2, 3], dtype='uint64')
233+
234+
235+ .. _whatsnew_140.deprecations.other :
236+
237+ Other Deprecations
238+ ^^^^^^^^^^^^^^^^^^
205239- Deprecated :meth: `Index.is_type_compatible ` (:issue: `42113 `)
206240- Deprecated ``method `` argument in :meth: `Index.get_loc `, use ``index.get_indexer([label], method=...) `` instead (:issue: `42269 `)
207241- Deprecated treating integer keys in :meth: `Series.__setitem__ ` as positional when the index is a :class: `Float64Index ` not containing the key, a :class: `IntervalIndex ` with no entries containing the key, or a :class: `MultiIndex ` with leading :class: `Float64Index ` level not containing the key (:issue: `33469 `)
0 commit comments