-
-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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/BUG: pd.date_range() still defaults to nanosecond resolution #59031
Comments
Hi @jorisvandenbossche I made a few additions to the date_range function. Let me know what you think! |
Hi @jorisvandenbossche , @jbrockmendel . I was trying to work on this issue and had a question about how would defaulting to 'second' resolution impact the OutOfBoundsDatetime exceptions that is raised in pandas/pandas/core/arrays When the resolution is default set to second the stride value is reduced by a factor 10**9 and affects the calculation on pandas/pandas/core/arrays/_ranges.py Line 127 in e78ebd3
and no exceptions are raised. Current functionality:
When default resolution set to second:
Is is expected that the bounds increase after defaulting to second resolution? Or the functionality that currently exists needs to be retained? |
After #55901,
to_datetime
with strings will now infer the resolution from the data, but the relatedpd.date_range
to create datetime data still returns nanoseconds:Should we update
pd.date_range
as well to infer the resulting resolution from the start/stop timestamp and freq ?(I encountered this inconsistency in the pyarrow tests, where we essentially were using both idioms to create a result and expected data, but so that started failing because of a different dtype. I also opened #58989 for that, but regardless of a possible default resolution,
pd.date_range
would still need to follow that as well)The text was updated successfully, but these errors were encountered: