Skip to content

Commit bab714d

Browse files
DOC: add SA01,ES01 for pandas.Timestamp.to_pydatetime
1 parent 529bcc1 commit bab714d

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

pandas/_libs/tslibs/timestamps.pyx

+23-1
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,29 @@ cdef class _Timestamp(ABCTimestamp):
11961196
"""
11971197
Convert a Timestamp object to a native Python datetime object.
11981198
1199-
If warn=True, issue a warning if nanoseconds is nonzero.
1199+
This method is useful for when you need to utilize a pandas Timestamp
1200+
object in contexts where native Python datetime objects are expected
1201+
or required. The conversion discards the nanoseconds component, and a
1202+
warning can be issued in such cases if desired.
1203+
1204+
Parameters
1205+
----------
1206+
warn : bool, default True
1207+
If True, issues a warning when the timestamp includes nonzero
1208+
nanoseconds, as these will be discarded during the conversion.
1209+
1210+
Returns
1211+
-------
1212+
datetime.datetime or NaT
1213+
Returns a datetime.datetime object representing the timestamp,
1214+
with year, month, day, hour, minute, second, and microsecond components.
1215+
If the timestamp is NaT (Not a Time), returns NaT.
1216+
1217+
See Also
1218+
--------
1219+
datetime.datetime : The standard Python datetime class that this method returns.
1220+
Timestamp.timestamp : Convert a Timestamp object to POSIX timestamp.
1221+
Timestamp.to_datetime64 : Convert a Timestamp object to numpy.datetime64.
12001222
12011223
Examples
12021224
--------

0 commit comments

Comments
 (0)