Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix docstring timedelta index#59698 #59706

4 changes: 0 additions & 4 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Series.sparse.from_coo PR07,SA01" \
-i "pandas.Series.sparse.npoints SA01" \
-i "pandas.Series.sparse.sp_values SA01" \
-i "pandas.Timedelta.asm8 SA01" \
-i "pandas.Timedelta.ceil SA01" \
-i "pandas.Timedelta.components SA01" \
-i "pandas.Timedelta.floor SA01" \
-i "pandas.Timedelta.max PR02" \
-i "pandas.Timedelta.min PR02" \
-i "pandas.Timedelta.resolution PR02" \
-i "pandas.Timedelta.round SA01" \
-i "pandas.Timedelta.to_numpy PR01" \
-i "pandas.Timedelta.to_timedelta64 SA01" \
-i "pandas.Timedelta.total_seconds SA01" \
Expand Down
32 changes: 32 additions & 0 deletions pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1498,6 +1498,12 @@ cdef class _Timedelta(timedelta):
numpy timedelta64 array scalar view
Array scalar view of the timedelta in nanoseconds.

See Also
--------
Timedelta.total_seconds : Return the total seconds in the duration.
Timedelta.components : Return a namedtuple of the Timedelta's components.
Timedelta.to_timedelta64 : Convert the Timedelta to a numpy.timedelta64.

Examples
--------
>>> td = pd.Timedelta('1 days 2 min 3 us 42 ns')
Expand Down Expand Up @@ -2061,6 +2067,12 @@ class Timedelta(_Timedelta):
------
ValueError if the freq cannot be converted

See Also
--------
Timedelta.floor : Floor the Timedelta to the specified resolution.
Timedelta.round : Round the Timedelta to the nearest specified resolution.
Timestamp.ceil : Similar method for Timestamp objects.

Examples
--------
>>> td = pd.Timedelta('1001ms')
Expand All @@ -2081,6 +2093,16 @@ class Timedelta(_Timedelta):
Frequency string indicating the flooring resolution.
It uses the same units as class constructor :class:`~pandas.Timedelta`.

Returns
-------
Timedelta
A new Timedelta object floored to the specified resolution.

See Also
--------
Timestamp.ceil : Round the Timestamp up to the nearest specified resolution.
Timestamp.round : Round the Timestamp to the nearest specified resolution.

Examples
--------
>>> td = pd.Timedelta('1001ms')
Expand All @@ -2101,6 +2123,16 @@ class Timedelta(_Timedelta):
Frequency string indicating the ceiling resolution.
It uses the same units as class constructor :class:`~pandas.Timedelta`.

Returns
-------
Timedelta
A new Timedelta object ceiled to the specified resolution.

See Also
--------
Timedelta.floor : Floor the Timedelta to the specified resolution.
Timedelta.round : Round the Timedelta to the nearest specified resolution.

Examples
--------
>>> td = pd.Timedelta('1001ms')
Expand Down
Loading