Skip to content

Commit 2c193a0

Browse files
jorisvandenbosscheJustinZhengBC
authored andcommitted
Update description of Index._values/values/ndarray_values (pandas-dev#23507)
1 parent b62634f commit 2c193a0

File tree

1 file changed

+9
-13
lines changed

1 file changed

+9
-13
lines changed

pandas/core/indexes/base.py

+9-13
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ def values(self):
709709

710710
@property
711711
def _values(self):
712-
# type: () -> Union[ExtensionArray, Index]
712+
# type: () -> Union[ExtensionArray, Index, np.ndarray]
713713
# TODO(EA): remove index types as they become extension arrays
714714
"""The best array representation.
715715
@@ -721,18 +721,14 @@ def _values(self):
721721
722722
It may differ from the public '.values' method.
723723
724-
index | values | _values | _ndarray_values |
725-
----------------- | -------------- -| ----------- | --------------- |
726-
CategoricalIndex | Categorical | Categorical | codes |
727-
DatetimeIndex[tz] | ndarray[M8ns] | DTI[tz] | ndarray[M8ns] |
728-
729-
For the following, the ``._values`` is currently ``ndarray[object]``,
730-
but will soon be an ``ExtensionArray``
731-
732-
index | values | _values | _ndarray_values |
733-
----------------- | --------------- | ------------ | --------------- |
734-
PeriodIndex | ndarray[object] | ndarray[obj] | ndarray[int] |
735-
IntervalIndex | ndarray[object] | ndarray[obj] | ndarray[object] |
724+
index | values | _values | _ndarray_values |
725+
----------------- | --------------- | ------------- | --------------- |
726+
Index | ndarray | ndarray | ndarray |
727+
CategoricalIndex | Categorical | Categorical | ndarray[int] |
728+
DatetimeIndex | ndarray[M8ns] | ndarray[M8ns] | ndarray[M8ns] |
729+
DatetimeIndex[tz] | ndarray[M8ns] | DTI[tz] | ndarray[M8ns] |
730+
PeriodIndex | ndarray[object] | PeriodArray | ndarray[int] |
731+
IntervalIndex | IntervalArray | IntervalArray | ndarray[object] |
736732
737733
See Also
738734
--------

0 commit comments

Comments
 (0)