From 8e14743a350adf3466d37a9c76df37e8b2f502ef Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 5 Nov 2018 12:00:47 +0100 Subject: [PATCH 1/3] Update description of Index._values/values/ndarray_values --- pandas/core/indexes/base.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index ae64179b36485..294d0b152f1be 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -709,7 +709,7 @@ def values(self): @property def _values(self): - # type: () -> Union[ExtensionArray, Index] + # type: () -> Union[ExtensionArray, Index, np.ndarray] # TODO(EA): remove index types as they become extension arrays """The best array representation. @@ -721,18 +721,14 @@ def _values(self): It may differ from the public '.values' method. - index | values | _values | _ndarray_values | - ----------------- | -------------- -| ----------- | --------------- | - CategoricalIndex | Categorical | Categorical | codes | - DatetimeIndex[tz] | ndarray[M8ns] | DTI[tz] | ndarray[M8ns] | - - For the following, the ``._values`` is currently ``ndarray[object]``, - but will soon be an ``ExtensionArray`` - - index | values | _values | _ndarray_values | - ----------------- | --------------- | ------------ | --------------- | - PeriodIndex | ndarray[object] | ndarray[obj] | ndarray[int] | - IntervalIndex | ndarray[object] | ndarray[obj] | ndarray[object] | + index | values | _values | _ndarray_values | + ----------------- | --------------- | ------------- | --------------- | + Index | ndarray | ndarray | ndarray | + CategoricalIndex | Categorical | Categorical | codes | + DatetimeIndex | ndarray[M8ns] | ndarray[M8ns] | ndarray[M8ns] | + DatetimeIndex[tz] | ndarray[M8ns] | DTI[tz] | ndarray[M8ns] | + PeriodIndex | ndarray[object] | PeriodArray | ndarray[int] | + IntervalIndex | IntervalArray | IntervalArray | ndarray[object] | See Also -------- From ad6a4a4de641f47e2a2a53a806ae3c81c8f15d5e Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Mon, 5 Nov 2018 22:12:35 +0100 Subject: [PATCH 2/3] codes -> ndarray[int] --- pandas/core/indexes/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 294d0b152f1be..9621479f48c48 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -724,7 +724,7 @@ def _values(self): index | values | _values | _ndarray_values | ----------------- | --------------- | ------------- | --------------- | Index | ndarray | ndarray | ndarray | - CategoricalIndex | Categorical | Categorical | codes | + CategoricalIndex | Categorical | Categorical | ndarray[int] | DatetimeIndex | ndarray[M8ns] | ndarray[M8ns] | ndarray[M8ns] | DatetimeIndex[tz] | ndarray[M8ns] | DTI[tz] | ndarray[M8ns] | PeriodIndex | ndarray[object] | PeriodArray | ndarray[int] | From 36543b9fa1ddeabeacff709066497f19c7ba3d73 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Tue, 6 Nov 2018 08:28:29 -0600 Subject: [PATCH 3/3] merge master [ci skip]