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

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

Closed
Lamarth opened this issue Oct 26, 2012 · 3 comments
Closed

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

Lamarth opened this issue Oct 26, 2012 · 3 comments
Labels
Bug Datetime Datetime data dtype Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@Lamarth
Copy link

Lamarth commented Oct 26, 2012

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

@wesm
Copy link
Member

wesm commented Nov 2, 2012

@changhiskhan did a2085e6 fix this?

@changhiskhan
Copy link
Contributor

yeah, I just have it return self/other if self/other is length 0

@wesm wesm closed this as completed Nov 2, 2012
@Lamarth
Copy link
Author

Lamarth commented Nov 8, 2012

Thanks for the fixes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Datetime Datetime data dtype Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

No branches or pull requests

3 participants