-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Add dateutil timezone support #4688
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
@prossahl after thinking it over, unless you have a specific reason in mind why this is necessary (as opposed to using a pytz timezone instead), I don't think we are going to incorporate this. Just wanted to give you a heads up before you spend more time on this. |
I don't see the problem honestly. But I haven't looked at the PR yet, doing so now |
@wesm adds complexity and it's not clear what it adds in usefulness? |
It does add complexity but what I meant is that in reality you might see cases where |
that's helpful context. |
Thanks for the comments. My motive for doing this was that quite a lot of people (including us!) use the >>> ts = pd.Timestamp('2013-08-30 12:00', tz=dateutil.tz.gettz('US/Eastern'))
>>> ts.astimezone(tz=dateutil.tz.gettz('US/Pacific'))
Exception AttributeError: "'NoneType' object has no attribute 'toordinal'" in 'pandas.tslib._localize_tso' ignored
<Timestamp: 2013-08-30 16:00:00> This seems to be little dangerous for This issue does (a) and seems to be a small change to be able to inter-operate with both the time zone libraries in common use. An alternative is (b), with some small performance impact, which would mean working out the correspondence between dateutil and pytz. Something like: pytz.timezone('/'.join(du_tz._filename.split('/')[-2:])) would work but there are some corner cases like UTC. I do realise that you may want to remove a dependency on |
Thank you for laying that out for us - I appreciate you taking the time to |
This enhancement allows Pandas to use
dateutil
timezones as well as the defaultpytz
ones. TheTimestamp
's would be inter-operable.It has required a bit of coding in
tslib.pyx
to discriminate betweenpytz
anddateutil
tzinfo objects and load the appropriate data into the cache.I'll create PR for this.
The text was updated successfully, but these errors were encountered: