dtstr = '11/06/2011 01:00' tz = "US/Eastern" >>> pd.Timestamp(dtstr, tz=tz) Timestamp('2011-11-06 01:00:00-0500', tz='US/Eastern') >>> pd.Timestamp(dtstr).tz_localize(tz) pytz.exceptions.AmbiguousTimeError: Cannot infer dst time from 2011-11-06 01:00:00, try using the 'ambiguous' argument
I expected these to be equivalent. Am I wrong to expect that?
Looks like the constructor version goes through _localize_pydatetime (then pytz's tz.localize) instead of Timestamp.tz_localize which apparently doesn't find this case ambiguous.
Update: passing is_dst=None
to tz.localize
in _localize_pydatetime causes the constructor version to raise like I expected.
Update 2: passing is_dst=None as above breaks two tests in the test suite: test_dti_tz_localize_ambiguous_infer and test_fallback_singular
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4