Skip to content

BUG: invalid construction from repr of dt-aware index #15938

Closed
@jreback

Description

@jreback

thought we had an issue about this....

The data is converted from string and is tz-aware, then the dtype convert is also applied.

In [1]: dt = pd.date_range('20160101', periods=1, tz='US/Eastern')

In [2]: dt
Out[2]: DatetimeIndex(['2016-01-01 00:00:00-05:00'], dtype='datetime64[ns, US/Eastern]', freq='D')

In [3]: r = DatetimeIndex(['2016-01-01 00:00:00-05:00'], dtype='datetime64[ns, US/Eastern]', freq='D')

In [4]: r
Out[4]: DatetimeIndex(['2016-01-01 05:00:00-05:00'], dtype='datetime64[ns, US/Eastern]', freq='D')

In [5]: dt.equals(r)
Out[5]: False

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions