Skip to content
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

BUG: Index with integer data and datetime64[ns, tz] dtype does not localize correctly #20964

Closed
mroeschke opened this issue May 6, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@mroeschke
Copy link
Member

commented May 6, 2018

In [1]: pd.__version__
Out[1]: '0.23.0rc2+16.gccf4b96.dirty'

In [2]: val = [pd.Timestamp('2018-01-01', tz='US/Pacific').value]

In [3]: pd.Index(val, dtype='datetime64[ns, US/Pacific]')
Out[3]: DatetimeIndex(['2018-01-01 08:00:00-08:00'], dtype='datetime64[ns, US/Pacific]', freq=None)

The localization appears to localize directly to the timezone instead of localizing first to UTC and therefore does not roundtrip correctly from the timestamp value.

#20956 can be simplified once this is fixed.

Expected:

Out[3]: DatetimeIndex(['2018-01-01 00:00:00-08:00'], dtype='datetime64[ns, US/Pacific]', freq=None)

@mroeschke mroeschke changed the title BUG: Index with datetime64[ns, tz] dtype does not localize correctly BUG: Index with integer data and datetime64[ns, tz] dtype does not localize correctly May 7, 2018

@jreback

This comment has been minimized.

Copy link
Contributor

commented May 10, 2018

hmm I think there is an open issue about this already, if you'd have a look

@jreback jreback added this to the 0.24.0 milestone May 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.