-
-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
BugDuplicate ReportDuplicate issue or pull requestDuplicate issue or pull requestIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvesTestingpandas testing functions or related to the test suitepandas testing functions or related to the test suiteTimezonesTimezone data dtypeTimezone data dtype
Description
DatetimeIndex
fails to find its own values if a timezone is used:
index = pd.DatetimeIndex(['2016-06-28 08:30:00.123456789'], dtype='datetime64[ns, America/Chicago]')
df = pd.DataFrame({'a':[10]}, index=index)
df.loc[df.index[0]]
It fails with:
*** KeyError: 'the label [2016-06-28 08:30:00.123456789-05:00] is not in the [index]'
This is impossible.
It works if you use only microseconds rather than nanoseconds, and it works if you don't set a timezone.
Pandas 0.18.1.
Metadata
Metadata
Assignees
Labels
BugDuplicate ReportDuplicate issue or pull requestDuplicate issue or pull requestIndexingRelated to indexing on series/frames, not to indexes themselvesRelated to indexing on series/frames, not to indexes themselvesTestingpandas testing functions or related to the test suitepandas testing functions or related to the test suiteTimezonesTimezone data dtypeTimezone data dtype