@@ -92,16 +92,20 @@ if you compute the levels and labels yourself, please be careful.
92
92
Values
93
93
~~~~~~
94
94
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.
105
109
106
110
107
111
.. _ref-subclassing-pandas :
0 commit comments