Skip to content

Commit efbc296

Browse files
DOC: fix SA01, ES01 for pandas.Timedelta.to_timedelta64 (#59860)
* DOC: fix SA01, ES01 for pandas.Timedelta.to_timedelta64 * DOC: add double backticks for sphinx compatibility Co-authored-by: mroeschke <[email protected]> --------- Co-authored-by: mroeschke <[email protected]>
1 parent 22055e4 commit efbc296

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
101101
-i "pandas.Timedelta.max PR02" \
102102
-i "pandas.Timedelta.min PR02" \
103103
-i "pandas.Timedelta.resolution PR02" \
104-
-i "pandas.Timedelta.to_timedelta64 SA01" \
105104
-i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \
106105
-i "pandas.Timestamp.max PR02" \
107106
-i "pandas.Timestamp.min PR02" \

pandas/_libs/tslibs/timedeltas.pyx

+12
Original file line numberDiff line numberDiff line change
@@ -1411,6 +1411,18 @@ cdef class _Timedelta(timedelta):
14111411
"""
14121412
Return a numpy.timedelta64 object with 'ns' precision.
14131413

1414+
Since NumPy uses ``timedelta64`` objects for its time operations, converting
1415+
a pandas ``Timedelta`` into a NumPy ``timedelta64`` provides seamless
1416+
integration between the two libraries, especially when working in environments
1417+
that heavily rely on NumPy for array-based calculations.
1418+
1419+
See Also
1420+
--------
1421+
to_timedelta : Convert argument to timedelta.
1422+
numpy.timedelta64 : A NumPy object for time duration.
1423+
Timedelta : Represents a duration, the difference between two dates
1424+
or times.
1425+
14141426
Examples
14151427
--------
14161428
>>> td = pd.Timedelta('3D')

0 commit comments

Comments
 (0)