Skip to content

Commit bc9b1c3

Browse files
authored
Fix part of docstring timedelta index#59698 (#59707)
* fix pandas.Timestamp.fold GL08 * fix pandas.Timestamp.fold GL08 * remove i- pandas.Timestamp.fold GL08 * fix pre-commit error * fix docstring error * add see also for ceil,floor,asm8,round * remove ceil,floor,asm8,round from code_checks.sh
1 parent 059ae31 commit bc9b1c3

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

ci/code_checks.sh

-4
Original file line numberDiff line numberDiff line change
@@ -109,14 +109,10 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
109109
-i "pandas.Series.sparse.from_coo PR07,SA01" \
110110
-i "pandas.Series.sparse.npoints SA01" \
111111
-i "pandas.Series.sparse.sp_values SA01" \
112-
-i "pandas.Timedelta.asm8 SA01" \
113-
-i "pandas.Timedelta.ceil SA01" \
114112
-i "pandas.Timedelta.components SA01" \
115-
-i "pandas.Timedelta.floor SA01" \
116113
-i "pandas.Timedelta.max PR02" \
117114
-i "pandas.Timedelta.min PR02" \
118115
-i "pandas.Timedelta.resolution PR02" \
119-
-i "pandas.Timedelta.round SA01" \
120116
-i "pandas.Timedelta.to_numpy PR01" \
121117
-i "pandas.Timedelta.to_timedelta64 SA01" \
122118
-i "pandas.Timedelta.total_seconds SA01" \

pandas/_libs/tslibs/timedeltas.pyx

+32
Original file line numberDiff line numberDiff line change
@@ -1498,6 +1498,12 @@ cdef class _Timedelta(timedelta):
14981498
numpy timedelta64 array scalar view
14991499
Array scalar view of the timedelta in nanoseconds.
15001500

1501+
See Also
1502+
--------
1503+
Timedelta.total_seconds : Return the total seconds in the duration.
1504+
Timedelta.components : Return a namedtuple of the Timedelta's components.
1505+
Timedelta.to_timedelta64 : Convert the Timedelta to a numpy.timedelta64.
1506+
15011507
Examples
15021508
--------
15031509
>>> td = pd.Timedelta('1 days 2 min 3 us 42 ns')
@@ -2061,6 +2067,12 @@ class Timedelta(_Timedelta):
20612067
------
20622068
ValueError if the freq cannot be converted
20632069
2070+
See Also
2071+
--------
2072+
Timedelta.floor : Floor the Timedelta to the specified resolution.
2073+
Timedelta.round : Round the Timedelta to the nearest specified resolution.
2074+
Timestamp.ceil : Similar method for Timestamp objects.
2075+
20642076
Examples
20652077
--------
20662078
>>> td = pd.Timedelta('1001ms')
@@ -2081,6 +2093,16 @@ class Timedelta(_Timedelta):
20812093
Frequency string indicating the flooring resolution.
20822094
It uses the same units as class constructor :class:`~pandas.Timedelta`.
20832095
2096+
Returns
2097+
-------
2098+
Timedelta
2099+
A new Timedelta object floored to the specified resolution.
2100+
2101+
See Also
2102+
--------
2103+
Timestamp.ceil : Round the Timestamp up to the nearest specified resolution.
2104+
Timestamp.round : Round the Timestamp to the nearest specified resolution.
2105+
20842106
Examples
20852107
--------
20862108
>>> td = pd.Timedelta('1001ms')
@@ -2101,6 +2123,16 @@ class Timedelta(_Timedelta):
21012123
Frequency string indicating the ceiling resolution.
21022124
It uses the same units as class constructor :class:`~pandas.Timedelta`.
21032125
2126+
Returns
2127+
-------
2128+
Timedelta
2129+
A new Timedelta object ceiled to the specified resolution.
2130+
2131+
See Also
2132+
--------
2133+
Timedelta.floor : Floor the Timedelta to the specified resolution.
2134+
Timedelta.round : Round the Timedelta to the nearest specified resolution.
2135+
21042136
Examples
21052137
--------
21062138
>>> td = pd.Timedelta('1001ms')

0 commit comments

Comments
 (0)