-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DOC: how to_datetime %S differs from strptime #47134
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
Comments
Hi, I would to like work on this issue. |
Thanks for the suggestion, sounds good - as noted in https://github.com/pandas-dev/pandas/pull/47164/files#r884317700 , it would be good to include an example |
Let me add an example on this. |
@MarcoGorelli I think @mdavis-xyz required to revise the html document, not the pandas/core/tools/datetimes.py. |
Is this issue still open ?. If yes then I would like to work on it |
I am interested in working on this issue. |
Yes I think this issue is still open. That PR was closed as stale. I think the reviewers wanted examples included. |
* doc update for #47134 * black and trailing spaces fixed * rewording_1 #48376 Co-authored-by: Marco Edward Gorelli <[email protected]> * rewording_2 #48376 Co-authored-by: Marco Edward Gorelli <[email protected]> Co-authored-by: Marco Edward Gorelli <[email protected]>
Part of this needs reverting, #49231 |
* doc update for pandas-dev#47134 * black and trailing spaces fixed * rewording_1 pandas-dev#48376 Co-authored-by: Marco Edward Gorelli <[email protected]> * rewording_2 pandas-dev#48376 Co-authored-by: Marco Edward Gorelli <[email protected]> Co-authored-by: Marco Edward Gorelli <[email protected]>
Pandas version checks
main
hereLocation of the documentation
https://pandas.pydata.org/docs/dev/reference/api/pandas.to_datetime.html?highlight=to_datetime#pandas.to_datetime
Documentation problem
The documentation says that the formatting strings used by
pandas.to_datetime
are the same asdatetime.strptime
, other than the number of digits%f
handles.This is not quite true, there is another difference.
pandas.to_datetime
with%S
(without%f
) will capture microseconds.strptime
will throw an error. (Which makes pandas.to_datetime more useful than strptime)The second-last line passes,
the last line throws
ValueError: unconverted data remains: .123
.Suggested fix for documentation
Change:
to:
The text was updated successfully, but these errors were encountered: