diff --git a/ci/code_checks.sh b/ci/code_checks.sh index b009212084dde..0714c6f74f0c2 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -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" \ diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index d5348311f19e2..36be1812b0187 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -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') @@ -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') @@ -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') @@ -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')