MCPcopy
hub / github.com/pandas-dev/pandas / _values

Method _values

pandas/core/series.py:790–821  ·  view source on GitHub ↗

Return the internal repr of this data (defined by Block.interval_values). This are the values as stored in the Block (ndarray or ExtensionArray depending on the Block class), with datetime64[ns] and timedelta64[ns] wrapped in ExtensionArrays to match Index._values be

(self)

Source from the content-addressed store, hash-verified

788
789 @property
790 def _values(self):
791 """
792 Return the internal repr of this data (defined by Block.interval_values).
793 This are the values as stored in the Block (ndarray or ExtensionArray
794 depending on the Block class), with datetime64[ns] and timedelta64[ns]
795 wrapped in ExtensionArrays to match Index._values behavior.
796
797 Differs from the public ``.values`` for certain data types, because of
798 historical backwards compatibility of the public attribute (e.g. period
799 returns object ndarray and datetimetz a datetime64[ns] ndarray for
800 ``.values`` while it returns an ExtensionArray for ``._values`` in those
801 cases).
802
803 Differs from ``.array`` in that this still returns the numpy array if
804 the Block is backed by a numpy array (except for datetime64 and
805 timedelta64 dtypes), while ``.array`` ensures to always return an
806 ExtensionArray.
807
808 Overview:
809
810 dtype | values | _values | array |
811 ----------- | ------------- | ------------- | --------------------- |
812 Numeric | ndarray | ndarray | NumpyExtensionArray |
813 Category | Categorical | Categorical | Categorical |
814 dt64[ns] | ndarray[M8ns] | DatetimeArray | DatetimeArray |
815 dt64[ns tz] | ndarray[M8ns] | DatetimeArray | DatetimeArray |
816 td64[ns] | ndarray[m8ns] | TimedeltaArray| TimedeltaArray |
817 Period | ndarray[obj] | PeriodArray | PeriodArray |
818 Nullable | EA | EA | EA |
819
820 """
821 return self._mgr.internal_values()
822
823 @property
824 def _references(self) -> BlockValuesRefs:

Callers

nothing calls this directly

Calls 1

internal_valuesMethod · 0.80

Tested by

no test coverage detected