@@ -493,7 +493,8 @@ def _values(self):
493
493
"""
494
494
Return the internal repr of this data (defined by Block.interval_values).
495
495
This are the values as stored in the Block (ndarray or ExtensionArray
496
- depending on the Block class).
496
+ depending on the Block class), with datetime64[ns] and timedelta64[ns]
497
+ wrapped in ExtensionArrays to match Index._values behavior.
497
498
498
499
Differs from the public ``.values`` for certain data types, because of
499
500
historical backwards compatibility of the public attribute (e.g. period
@@ -502,8 +503,9 @@ def _values(self):
502
503
cases).
503
504
504
505
Differs from ``.array`` in that this still returns the numpy array if
505
- the Block is backed by a numpy array, while ``.array`` ensures to always
506
- return an ExtensionArray.
506
+ the Block is backed by a numpy array (except for datetime64 and
507
+ timedelta64 dtypes), while ``.array`` ensures to always return an
508
+ ExtensionArray.
507
509
508
510
Differs from ``._ndarray_values``, as that ensures to always return a
509
511
numpy array (it will call ``_ndarray_values`` on the ExtensionArray, if
@@ -515,8 +517,9 @@ def _values(self):
515
517
----------- | ------------- | ------------- | ------------- | --------------- |
516
518
Numeric | ndarray | ndarray | PandasArray | ndarray |
517
519
Category | Categorical | Categorical | Categorical | ndarray[int] |
518
- dt64[ns] | ndarray[M8ns] | ndarray[M8ns] | DatetimeArray | ndarray[M8ns] |
520
+ dt64[ns] | ndarray[M8ns] | DatetimeArray | DatetimeArray | ndarray[M8ns] |
519
521
dt64[ns tz] | ndarray[M8ns] | DatetimeArray | DatetimeArray | ndarray[M8ns] |
522
+ td64[ns] | ndarray[m8ns] | TimedeltaArray| ndarray[m8ns] | ndarray[m8ns] |
520
523
Period | ndarray[obj] | PeriodArray | PeriodArray | ndarray[int] |
521
524
Nullable | EA | EA | EA | ndarray |
522
525
0 commit comments