Skip to content

Commit a7fb691

Browse files
committed
fix some docstring errors
1 parent bc9b1c3 commit a7fb691

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

ci/code_checks.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,9 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
113113
-i "pandas.Timedelta.max PR02" \
114114
-i "pandas.Timedelta.min PR02" \
115115
-i "pandas.Timedelta.resolution PR02" \
116-
-i "pandas.Timedelta.to_numpy PR01" \
117116
-i "pandas.Timedelta.to_timedelta64 SA01" \
118117
-i "pandas.Timedelta.total_seconds SA01" \
119118
-i "pandas.Timedelta.view SA01" \
120-
-i "pandas.TimedeltaIndex.components SA01" \
121-
-i "pandas.TimedeltaIndex.microseconds SA01" \
122119
-i "pandas.TimedeltaIndex.nanoseconds SA01" \
123120
-i "pandas.TimedeltaIndex.seconds SA01" \
124121
-i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,9 +1421,16 @@ cdef class _Timedelta(timedelta):
14211421
"""
14221422
Convert the Timedelta to a NumPy timedelta64.
14231423

1424-
This is an alias method for `Timedelta.to_timedelta64()`. The dtype and
1425-
copy parameters are available here only for compatibility. Their values
1426-
will not affect the return value.
1424+
This is an alias method for `Timedelta.to_timedelta64()`.
1425+
1426+
Parameters
1427+
----------
1428+
dtype : NoneType
1429+
It is available here only for compatibility. Its value will not
1430+
affect the return value.
1431+
copy : bool, default False
1432+
It is available here only for compatibility. Its value will not
1433+
affect the return value.
14271434

14281435
Returns
14291436
-------

pandas/core/arrays/timedeltas.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,12 @@ def to_pytimedelta(self) -> npt.NDArray[np.object_]:
876876
microseconds_docstring = textwrap.dedent(
877877
"""Number of microseconds (>= 0 and less than 1 second) for each element.
878878
879+
See Also
880+
--------
881+
pd.Timedelta.microseconds : Number of microseconds (>= 0 and less than 1 second).
882+
pd.Timedelta.to_pytimedelta.microseconds : Number of microseconds (>= 0 and less
883+
than 1 second) of a datetime.timedelta.
884+
879885
Examples
880886
--------
881887
For Series:
@@ -955,6 +961,12 @@ def components(self) -> DataFrame:
955961
-------
956962
DataFrame
957963
964+
See Also
965+
--------
966+
TimedeltaIndex.total_seconds : Return total duration expressed in seconds.
967+
Timedelta.components : Return a components namedtuple-like of a single
968+
timedelta.
969+
958970
Examples
959971
--------
960972
>>> tdelta_idx = pd.to_timedelta(["1 day 3 min 2 us 42 ns"])

0 commit comments

Comments
 (0)