Skip to content

to_timedelta docs warning on default behaviour #42285

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion doc/source/user_guide/timedeltas.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down