From 3ed5738bfae4608e9dc1fe36d96a37b6eea48954 Mon Sep 17 00:00:00 2001 From: Thomas Dickson Date: Mon, 28 Jun 2021 18:10:56 +0000 Subject: [PATCH] DOC GH34633 warning for default behaviour of to_timedelta --- doc/source/user_guide/timedeltas.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/source/user_guide/timedeltas.rst b/doc/source/user_guide/timedeltas.rst index 0b4ddaaa8a42a..180de1df53f9e 100644 --- a/doc/source/user_guide/timedeltas.rst +++ b/doc/source/user_guide/timedeltas.rst @@ -88,13 +88,19 @@ or a list/array of strings: pd.to_timedelta(["1 days 06:05:01.00003", "15.5us", "nan"]) -The ``unit`` keyword argument specifies the unit of the Timedelta: +The ``unit`` keyword argument specifies the unit of the Timedelta if the input +is numeric: .. ipython:: python pd.to_timedelta(np.arange(5), unit="s") pd.to_timedelta(np.arange(5), unit="d") +.. warning:: + If a string or array of strings is passed as an input then the ``unit`` keyword + argument will be ignored. If a string without units is passed then the default + unit of nanoseconds is assumed. + .. _timedeltas.limitations: Timedelta limitations