Skip to content

BUG: Bug in localizing an ambiguous timezone when a boolean is passed #14405

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

Closed
wants to merge 1 commit into from

Conversation

jreback
Copy link
Contributor

@jreback jreback commented Oct 12, 2016

closes #14402

In [1]: s = pd.Series([Timestamp('2015-11-01 01:00:03')])

In [2]: s
Out[2]: 
0   2015-11-01 01:00:03
dtype: datetime64[ns]

In [3]: s.dt.tz_localize('US/Central', ambiguous=False)
Out[3]: 
0   2015-11-01 01:00:03-06:00
dtype: datetime64[ns, US/Central]

In [4]: s.dt.tz_localize('US/Central', ambiguous=True)
Out[4]: 
0   2015-11-01 01:00:03-05:00
dtype: datetime64[ns, US/Central]

In [5]: s.dt.tz_localize('US/Central')
AmbiguousTimeError: Cannot infer dst time from Timestamp('2015-11-01 01:00:03'), try using the 'ambiguous' argument

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Timezones Timezone data dtype
Projects
None yet
1 participant