Skip to content

Commit a9882e2

Browse files
committed
Update dev docs
1 parent 32ee0ef commit a9882e2

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

doc/source/internals.rst

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,20 @@ if you compute the levels and labels yourself, please be careful.
9292
Values
9393
~~~~~~
9494

95-
Pandas extends NumPy's type system in a few places, so we have multiple notions of "values" floating around.
96-
For 1-D containers (``Index`` classes and ``Series``) we have the following convention:
97-
98-
* ``cls._ndarray_values`` is *always* and ``ndarray``
99-
* ``cls._values`` refers is the "best possible" array. This could be an ``ndarray``, ``ExtensionArray``, or
100-
in ``Index`` subclass (note: we're in the process of removing the index subclasses here so that it's
101-
always an ``ndarray`` or ``ExtensionArray``).
102-
103-
So, for example, ``Series[category]._values`` is a ``Categorical``, while ``Series[category]._ndarray_values`` is
104-
the underlying ndarray.
95+
Pandas extends NumPy's type system with custom types, like ``Categorical`` or
96+
datetimes with a timezone, so we have multiple notions of "values". For 1-D
97+
containers (``Index`` classes and ``Series``) we have the following convention:
98+
99+
* ``cls._ndarray_values`` is *always* a NumPy ``ndarray``. Ideally,
100+
``_ndarray_values`` is cheap to compute. For example, for a ``Categorical``,
101+
this returns the codes, not the array of objects.
102+
* ``cls._values`` refers is the "best possible" array. This could be an
103+
``ndarray``, ``ExtensionArray``, or in ``Index`` subclass (note: we're in the
104+
process of removing the index subclasses here so that it's always an
105+
``ndarray`` or ``ExtensionArray``).
106+
107+
So, for example, ``Series[category]._values`` is a ``Categorical``, while
108+
``Series[category]._ndarray_values`` is the underlying codes.
105109

106110

107111
.. _ref-subclassing-pandas:

0 commit comments

Comments
 (0)