Skip to content

Commit f329b24

Browse files
TAJDThomas Dickson
and
Thomas Dickson
authored
DOC GH34633 warning for default behaviour of to_timedelta (#42285)
Co-authored-by: Thomas Dickson <[email protected]>
1 parent 42adb9f commit f329b24

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/source/user_guide/timedeltas.rst

+7-1
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,19 @@ or a list/array of strings:
8888
8989
pd.to_timedelta(["1 days 06:05:01.00003", "15.5us", "nan"])
9090
91-
The ``unit`` keyword argument specifies the unit of the Timedelta:
91+
The ``unit`` keyword argument specifies the unit of the Timedelta if the input
92+
is numeric:
9293

9394
.. ipython:: python
9495
9596
pd.to_timedelta(np.arange(5), unit="s")
9697
pd.to_timedelta(np.arange(5), unit="d")
9798
99+
.. warning::
100+
If a string or array of strings is passed as an input then the ``unit`` keyword
101+
argument will be ignored. If a string without units is passed then the default
102+
unit of nanoseconds is assumed.
103+
98104
.. _timedeltas.limitations:
99105

100106
Timedelta limitations

0 commit comments

Comments
 (0)