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

Method values

pandas/core/series.py:747–787  ·  view source on GitHub ↗

Return Series as ndarray or ndarray-like depending on the dtype. .. warning:: We recommend using :attr:`Series.array` or :meth:`Series.to_numpy`, depending on whether you need a reference to the underlying data or a NumPy array. Returns

(self)

Source from the content-addressed store, hash-verified

745
746 @property
747 def values(self):
748 """
749 Return Series as ndarray or ndarray-like depending on the dtype.
750
751 .. warning::
752
753 We recommend using :attr:`Series.array` or
754 :meth:`Series.to_numpy`, depending on whether you need
755 a reference to the underlying data or a NumPy array.
756
757 Returns
758 -------
759 numpy.ndarray or ndarray-like
760
761 See Also
762 --------
763 Series.array : Reference to the underlying data.
764 Series.to_numpy : A NumPy array representing the underlying data.
765
766 Examples
767 --------
768 >>> pd.Series([1, 2, 3]).values
769 array([1, 2, 3])
770
771 >>> pd.Series(list("aabc")).values
772 <ArrowStringArray>
773 ['a', 'a', 'b', 'c']
774 Length: 4, dtype: str
775
776 >>> pd.Series(list("aabc")).astype("category").values
777 ['a', 'a', 'b', 'c']
778 Categories (3, str): ['a', 'b', 'c']
779
780 Timezone aware datetime data is converted to UTC:
781
782 >>> pd.Series(pd.date_range("20130101", periods=3, tz="US/Eastern")).values
783 array(['2013-01-01T05:00:00.000000',
784 '2013-01-02T05:00:00.000000',
785 '2013-01-03T05:00:00.000000'], dtype='datetime64[us]')
786 """
787 return self._mgr.external_values()
788
789 @property
790 def _values(self):

Callers 15

map_arrayFunction · 0.95
merge_classMethod · 0.45
_make_plotMethod · 0.45
_fMethod · 0.45
_init_dictMethod · 0.45
is_local_in_caller_frameFunction · 0.45
_decide_split_pathMethod · 0.45
append_to_multipleMethod · 0.45
walkMethod · 0.45
_parse_nodesMethod · 0.45
_iterparse_nodesMethod · 0.45

Calls 1

external_valuesMethod · 0.45