Skip to content

DOC: to_datetime outdated example #10733

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
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
14 changes: 3 additions & 11 deletions doc/source/timeseries.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,21 +208,13 @@ Pass ``errors='coerce'`` to convert invalid data to ``NaT`` (not a time):
:okexcept:

# this is the default, raise when unparseable
to_datetime(['2009-07-31', 'asd'], errors='raise')
to_datetime(['2009/07/31', 'asd'], errors='raise')

# return the original input when unparseable
to_datetime(['2009-07-31', 'asd'], errors='ignore')
to_datetime(['2009/07/31', 'asd'], errors='ignore')

# return NaT for input when unparseable
to_datetime(['2009-07-31', 'asd'], errors='coerce')


Take care, ``to_datetime`` may not act as you expect on mixed data:

.. ipython:: python
:okexcept:

to_datetime([1, '1'])
to_datetime(['2009/07/31', 'asd'], errors='coerce')

Epoch Timestamps
~~~~~~~~~~~~~~~~
Expand Down