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

Method to_pydatetime

pandas/core/arrays/datetimes.py:1130–1152  ·  view source on GitHub ↗

Return an ndarray of ``datetime.datetime`` objects. Returns ------- numpy.ndarray An ndarray of ``datetime.datetime`` objects. See Also -------- DatetimeIndex.to_julian_date : Converts Datetime Array to float64 ndarray

(self)

Source from the content-addressed store, hash-verified

1128 # Conversion Methods - Vectorized analogues of Timestamp methods
1129
1130 def to_pydatetime(self) -> npt.NDArray[np.object_]:
1131 """
1132 Return an ndarray of ``datetime.datetime`` objects.
1133
1134 Returns
1135 -------
1136 numpy.ndarray
1137 An ndarray of ``datetime.datetime`` objects.
1138
1139 See Also
1140 --------
1141 DatetimeIndex.to_julian_date : Converts Datetime Array to float64 ndarray
1142 of Julian Dates.
1143
1144 Examples
1145 --------
1146 >>> idx = pd.date_range("2018-02-27", periods=3)
1147 >>> idx.to_pydatetime()
1148 array([datetime.datetime(2018, 2, 27, 0, 0),
1149 datetime.datetime(2018, 2, 28, 0, 0),
1150 datetime.datetime(2018, 3, 1, 0, 0)], dtype=object)
1151 """
1152 return ints_to_pydatetime(self.asi8, tz=self.tz, reso=self._creso)
1153
1154 def normalize(self) -> Self:
1155 """

Callers 15

setupMethod · 0.45
setupMethod · 0.45
time_to_pydatetimeMethod · 0.45
time_to_pydatetimeMethod · 0.45
_hypothesis.pyFile · 0.45
_dt_to_pydatetimeMethod · 0.45
insert_dataMethod · 0.45
test_no_mlk_before_1986Function · 0.45
test_memorial_dayFunction · 0.45
test_calendarFunction · 0.45
test_non_datetime_index2Function · 0.45
test_to_pydatetimeMethod · 0.45

Calls

no outgoing calls