Skip to content

Commit 15e258a

Browse files
authored
DOC: fix-up numpy numeric Index docs (#51200)
1 parent af84a08 commit 15e258a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

doc/source/whatsnew/v2.0.0.rst

+6-7
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,14 @@ Below is a possibly non-exhaustive list of changes:
6565

6666
1. Instantiating using a numpy numeric array now follows the dtype of the numpy array.
6767
Previously, all indexes created from numpy numeric arrays were forced to 64-bit. Now,
68-
the index dtype follows the dtype of the numpy array. For example, it would for all
69-
signed integer arrays previously return an index with ``int64`` dtype, but will now
70-
reuse the dtype of the supplied numpy array. So ``Index(np.array([1, 2, 3]))`` will be ``int32`` on 32-bit systems.
68+
for example, ``Index(np.array([1, 2, 3]))`` will be ``int32`` on 32-bit systems, where
69+
it previously would have been ``int64``` even on 32-bit systems.
7170
Instantiating :class:`Index` using a list of numbers will still return 64bit dtypes,
7271
e.g. ``Index([1, 2, 3])`` will have a ``int64`` dtype, which is the same as previously.
73-
2. The various numeric datetime attributes of :class:`DateTimeIndex` (:attr:`~Date_TimeIndex.day`,
74-
:attr:`~DateTimeIndex.month`, :attr:`~DateTimeIndex.year` etc.) were previously in of
72+
2. The various numeric datetime attributes of :class:`DatetimeIndex` (:attr:`~DatetimeIndex.day`,
73+
:attr:`~DatetimeIndex.month`, :attr:`~DatetimeIndex.year` etc.) were previously in of
7574
dtype ``int64``, while they were ``int32`` for :class:`DatetimeArray`. They are now
76-
``int32`` on ``DateTimeIndex`` also:
75+
``int32`` on ``DatetimeIndex`` also:
7776

7877
.. ipython:: python
7978
@@ -92,7 +91,7 @@ Below is a possibly non-exhaustive list of changes:
9291
([3.0, 1.0, 2.0], ([1, 0, 0], [0, 2, 3])), shape=(3, 4)
9392
)
9493
ser = pd.Series.sparse.from_coo(A)
95-
ser.index.dtype
94+
ser.index.dtypes
9695
9796
4. :class:`Index` cannot be instantiated using a float16 dtype. Previously instantiating
9897
an :class:`Index` using dtype ``float16`` resulted in a :class:`Float64Index` with a

0 commit comments

Comments
 (0)