Skip to content

intersection on DatetimeIndex fails for empty indices of "quality" #2129

@Lamarth

Description

@Lamarth

index = pandas.DatetimeIndex(start='2000-01-01', periods=4, freq='T')
index[0:0].intersection(index)

Traceback (most recent call last):
File "", line 1, in
File "C:\dev\Python27\Lib\site-packages\pandas\tseries\index.py", line 845, in intersection
if self[0] <= other[0]:
File "C:\dev\Python27\Lib\site-packages\pandas\tseries\index.py", line 976, in getitem
val = arr_idx[key]
IndexError: index out of bounds

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDatetimeDatetime data dtypeIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions