Skip to content
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

ENH: Support non-nano inference in to_datetime #55096

Closed
1 of 3 tasks
Tracked by #55564
mroeschke opened this issue Sep 11, 2023 · 0 comments · Fixed by #55901
Closed
1 of 3 tasks
Tracked by #55564

ENH: Support non-nano inference in to_datetime #55096

mroeschke opened this issue Sep 11, 2023 · 0 comments · Fixed by #55901
Labels
Enhancement Non-Nano datetime64/timedelta64 with non-nanosecond resolution

Comments

@mroeschke
Copy link
Member

Feature Type

  • Adding new functionality to pandas

  • Changing existing functionality in pandas

  • Removing existing functionality in pandas

Problem Description

In [1]: import pandas as pd

In [2]: pd.to_datetime("1677-01-01 00:00:00")
OutOfBoundsDatetime: Out of bounds nanosecond timestamp: 1677-01-01 00:00:00, at position 0

In [3]: pd.Timestamp("1677-01-01 00:00:00")
Out[3]: Timestamp('1677-01-01 00:00:00')

Feature Description

It would be great if to_datetime would perform unit inference like Timestamp.

Looks mainly an issue with array_to_datetime still assuming ns resolution for strings

Alternative Solutions

Use Timestamp

Additional Context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Non-Nano datetime64/timedelta64 with non-nanosecond resolution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants