Skip to content

Commit

Permalink
Update description of Index._values/values/ndarray_values (pandas-dev…
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche authored and tm9k1 committed Nov 19, 2018
1 parent 1a2f0b1 commit b5bac2f
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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 | ndarray[int] |
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
--------
Expand Down

0 comments on commit b5bac2f

Please sign in to comment.