Skip to content

Commit 324d8b1

Browse files
committed
docstring arg order
1 parent da1a8bb commit 324d8b1

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

pandas/_libs/tslibs/timestamps.pyx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,22 +1804,22 @@ class Timestamp(_Timestamp):
18041804
Value of nanosecond.
18051805
tz : str, zoneinfo.ZoneInfo, pytz.timezone, dateutil.tz.tzfile or None
18061806
Time zone for time which Timestamp will have.
1807-
input_unit : str
1808-
Unit used for conversion if ts_input is of type int or float. The
1809-
valid values are 'W', 'D', 'h', 'm', 's', 'ms', 'us', and 'ns'. For
1810-
example, 's' means seconds and 'ms' means milliseconds.
1807+
unit : str or None, default None
1808+
Use input_unit instead.
18111809

1812-
For float inputs, the result will be stored in nanoseconds, and
1813-
the unit attribute will be set as ``'ns'``.
1810+
.. deprecated:: 3.0.0
18141811
fold : {0, 1}, default None, keyword-only
18151812
Due to daylight saving time, one wall clock time can occur twice
18161813
when shifting from summer to winter time; fold describes whether the
18171814
datetime-like corresponds to the first (0) or the second time (1)
18181815
the wall clock hits the ambiguous time.
1819-
unit : str or None, default None
1820-
Use input_unit instead.
1816+
input_unit : str
1817+
Unit used for conversion if ts_input is of type int or float. The
1818+
valid values are 'W', 'D', 'h', 'm', 's', 'ms', 'us', and 'ns'. For
1819+
example, 's' means seconds and 'ms' means milliseconds.
18211820

1822-
.. deprecated:: 3.0.0
1821+
For float inputs, the result will be stored in nanoseconds, and
1822+
the unit attribute will be set as ``'ns'``.
18231823

18241824
See Also
18251825
--------

pandas/core/tools/datetimes.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -772,11 +772,10 @@ def to_datetime(
772772
string.
773773
774774
Cannot be used alongside ``format='ISO8601'`` or ``format='mixed'``.
775-
input_unit : str, default 'ns'
776-
The unit of the arg (D,s,ms,us,ns) denote the unit, which is an
777-
integer or float number. This will be based off the origin.
778-
Example, with ``unit='ms'`` and ``origin='unix'``, this would calculate
779-
the number of milliseconds to the unix epoch start.
775+
unit : str or None, default None
776+
Use input_unit instead.
777+
778+
.. deprecated:: 3.0.0
780779
origin : scalar, default 'unix'
781780
Define the reference date. The numeric values would be parsed as number
782781
of units (defined by `unit`) since this reference date.
@@ -796,10 +795,11 @@ def to_datetime(
796795
is only used when there are at least 50 values. The presence of
797796
out-of-bounds values will render the cache unusable and may slow down
798797
parsing.
799-
unit : str or None, default None
800-
Use input_unit instead.
801-
802-
.. deprecated:: 3.0.0
798+
input_unit : str, default 'ns'
799+
The unit of the arg (D,s,ms,us,ns) denote the unit, which is an
800+
integer or float number. This will be based off the origin.
801+
Example, with ``unit='ms'`` and ``origin='unix'``, this would calculate
802+
the number of milliseconds to the unix epoch start.
803803
804804
Returns
805805
-------

pandas/core/tools/timedeltas.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ def to_timedelta(
117117
Strings with units 'M', 'Y' and 'y' do not represent
118118
unambiguous timedelta values and will raise an exception.
119119
120+
unit : str or None, default None
121+
Use input_unit instead.
122+
123+
.. deprecated:: 3.0.0
124+
125+
errors : {'raise', 'coerce'}, default 'raise'
126+
- If 'raise', then invalid parsing will raise an exception.
127+
- If 'coerce', then invalid parsing will be set as NaT.
120128
input_unit : str, optional
121129
Denotes the unit of the arg for numeric `arg`. Defaults to ``"ns"``.
122130
@@ -137,14 +145,6 @@ def to_timedelta(
137145
Units 'H'and 'S' are deprecated and will be removed
138146
in a future version. Please use 'h' and 's'.
139147
140-
errors : {'raise', 'coerce'}, default 'raise'
141-
- If 'raise', then invalid parsing will raise an exception.
142-
- 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
147-
148148
Returns
149149
-------
150150
timedelta

0 commit comments

Comments
 (0)