Skip to content

Commit 1218de7

Browse files
authored
DOC: whatsnew & linked edits (#24649)
1 parent 48c3ce5 commit 1218de7

File tree

4 files changed

+117
-112
lines changed

4 files changed

+117
-112
lines changed

doc/source/advanced.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ If you need integer based selection, you should use ``iloc``:
921921
922922
dfir.iloc[0:5]
923923
924-
.. _advanced.intervallindex:
924+
.. _advanced.intervalindex:
925925

926926
IntervalIndex
927927
~~~~~~~~~~~~~

doc/source/api/arrays.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -330,13 +330,13 @@ a :class:`pandas.api.types.CategoricalDtype`.
330330
:toctree: generated/
331331
:template: autosummary/class_without_autosummary.rst
332332

333-
api.types.CategoricalDtype
333+
CategoricalDtype
334334

335335
.. autosummary::
336336
:toctree: generated/
337337

338-
api.types.CategoricalDtype.categories
339-
api.types.CategoricalDtype.ordered
338+
CategoricalDtype.categories
339+
CategoricalDtype.ordered
340340

341341
Categorical data can be stored in a :class:`pandas.Categorical`
342342

doc/source/basics.rst

+10-8
Original file line numberDiff line numberDiff line change
@@ -64,37 +64,37 @@ NumPy's type system to add support for custom arrays
6464
(see :ref:`basics.dtypes`).
6565

6666
To get the actual data inside a :class:`Index` or :class:`Series`, use
67-
the **array** property
67+
the ``.array`` property
6868

6969
.. ipython:: python
7070
7171
s.array
7272
s.index.array
7373
7474
:attr:`~Series.array` will always be an :class:`~pandas.api.extensions.ExtensionArray`.
75-
The exact details of what an ``ExtensionArray`` is and why pandas uses them is a bit
75+
The exact details of what an :class:`~pandas.api.extensions.ExtensionArray` is and why pandas uses them is a bit
7676
beyond the scope of this introduction. See :ref:`basics.dtypes` for more.
7777

7878
If you know you need a NumPy array, use :meth:`~Series.to_numpy`
79-
or :meth:`numpy.asarray`.
79+
or :meth:`numpy.ndarray.asarray`.
8080

8181
.. ipython:: python
8282
8383
s.to_numpy()
8484
np.asarray(s)
8585
8686
When the Series or Index is backed by
87-
an :class:`~pandas.api.extension.ExtensionArray`, :meth:`~Series.to_numpy`
87+
an :class:`~pandas.api.extensions.ExtensionArray`, :meth:`~Series.to_numpy`
8888
may involve copying data and coercing values. See :ref:`basics.dtypes` for more.
8989

9090
:meth:`~Series.to_numpy` gives some control over the ``dtype`` of the
91-
resulting :class:`ndarray`. For example, consider datetimes with timezones.
91+
resulting :class:`numpy.ndarray`. For example, consider datetimes with timezones.
9292
NumPy doesn't have a dtype to represent timezone-aware datetimes, so there
9393
are two possibly useful representations:
9494

95-
1. An object-dtype :class:`ndarray` with :class:`Timestamp` objects, each
95+
1. An object-dtype :class:`numpy.ndarray` with :class:`Timestamp` objects, each
9696
with the correct ``tz``
97-
2. A ``datetime64[ns]`` -dtype :class:`ndarray`, where the values have
97+
2. A ``datetime64[ns]`` -dtype :class:`numpy.ndarray`, where the values have
9898
been converted to UTC and the timezone discarded
9999

100100
Timezones may be preserved with ``dtype=object``
@@ -106,6 +106,8 @@ Timezones may be preserved with ``dtype=object``
106106
107107
Or thrown away with ``dtype='datetime64[ns]'``
108108

109+
.. ipython:: python
110+
109111
ser.to_numpy(dtype="datetime64[ns]")
110112
111113
Getting the "raw data" inside a :class:`DataFrame` is possibly a bit more
@@ -137,7 +139,7 @@ drawbacks:
137139

138140
1. When your Series contains an :ref:`extension type <extending.extension-types>`, it's
139141
unclear whether :attr:`Series.values` returns a NumPy array or the extension array.
140-
:attr:`Series.array` will always return an ``ExtensionArray``, and will never
142+
:attr:`Series.array` will always return an :class:`~pandas.api.extensions.ExtensionArray`, and will never
141143
copy data. :meth:`Series.to_numpy` will always return a NumPy array,
142144
potentially at the cost of copying / coercing values.
143145
2. When your DataFrame contains a mixture of data types, :attr:`DataFrame.values` may

0 commit comments

Comments
 (0)