Skip to content

Commit 54ef5b6

Browse files
committed
docstring fixups
1 parent 6ac3620 commit 54ef5b6

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

pandas/_libs/tslibs/timedeltas.pyx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1309,7 +1309,7 @@ cdef class _Timedelta(timedelta):
13091309
Examples
13101310
--------
13111311
>>> td = pd.Timedelta(42, input_unit='us')
1312-
>>> ts.unit
1312+
>>> td.unit
13131313
'ns'
13141314
"""
13151315
return npy_unit_to_abbrev(self._creso)
@@ -1966,6 +1966,10 @@ class Timedelta(_Timedelta):
19661966
19671967
Allowing the values `w`, `d`, `MIN`, `MS`, `US` and `NS` to denote units
19681968
are deprecated in favour of the values `W`, `D`, `min`, `ms`, `us` and `ns`.
1969+
unit : str or None, default None
1970+
Use input_unit instead.
1971+
1972+
.. deprecated:: 3.0.0
19691973
19701974
**kwargs
19711975
Available kwargs: {days, seconds, microseconds,

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,6 +1816,10 @@ class Timestamp(_Timestamp):
18161816
when shifting from summer to winter time; fold describes whether the
18171817
datetime-like corresponds to the first (0) or the second time (1)
18181818
the wall clock hits the ambiguous time.
1819+
unit : str or None, default None
1820+
Use input_unit instead.
1821+
1822+
.. deprecated:: 3.0.0
18191823

18201824
See Also
18211825
--------

pandas/core/tools/datetimes.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,10 @@ def to_datetime(
796796
is only used when there are at least 50 values. The presence of
797797
out-of-bounds values will render the cache unusable and may slow down
798798
parsing.
799+
unit : str or None, default None
800+
Use input_unit instead.
801+
802+
.. deprecated:: 3.0.0
799803
800804
Returns
801805
-------

pandas/core/tools/timedeltas.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ def to_timedelta(
140140
errors : {'raise', 'coerce'}, default 'raise'
141141
- If 'raise', then invalid parsing will raise an exception.
142142
- If 'coerce', then invalid parsing will be set as NaT.
143+
unit : str or None, default None
144+
Use input_unit instead.
145+
146+
.. deprecated:: 3.0.0
143147
144148
Returns
145149
-------

0 commit comments

Comments
 (0)