Skip to content

Commit 7339680

Browse files
DOC: fix SA01, ES01 for pandas.Timedelta.to_timedelta64
1 parent 2419343 commit 7339680

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
104104
-i "pandas.Timedelta.max PR02" \
105105
-i "pandas.Timedelta.min PR02" \
106106
-i "pandas.Timedelta.resolution PR02" \
107-
-i "pandas.Timedelta.to_timedelta64 SA01" \
108107
-i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \
109108
-i "pandas.Timestamp.max PR02" \
110109
-i "pandas.Timestamp.min PR02" \

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 12 additions & 0 deletions
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 integration
1416+
between the two libraries, especially when working in environments that
1417+
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)