-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Allow choosing the utc timezone class in pd.to_datetime #32619
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
I don't think we need a separate keyword for this. I think we could accept |
I think that the weird thing is that when calling
I think that it would be more correct to fix the behavior of |
cc @mroeschke. I vaguely recall good reasons for them not comparing the same, but I don't recall them right now. |
I believe that Nonetheless, I think OP's example should work and just return a new I can see modifying |
I'd be -0.5 to allow UTC to accept non booleans as IMO it's idiomatic to use
|
The bug here is in tz_compare not considering the two different UTCs as equivalent. I agree with @mroeschke that we shouldnt change the to_datetime API. I would be +1 on changing our defaults from pytz to the stdlib tzinfo (and zoneinfo going forward) |
There is something that is not right also wrt.
The code on column
while
|
Looks like the original bug has been fix by #39216, but could use a test to exercise the arithmetic case of different utc timezones |
Code Sample, a copy-pastable example if possible
outputs
Problem description
There is no ability to specify which "UTC" the Timestamp should be. I suggest extending the interface of
pd.to_datetime()
to specifyutc_cls=pytz.UTC
.Expected Output
Output of
pd.show_versions()
The text was updated successfully, but these errors were encountered: