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

Comments

@Lamarth
Copy link

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

This comment has been minimized.

Copy link
Member

commented Nov 2, 2012

@changhiskhan did a2085e6 fix this?

@changhiskhan

This comment has been minimized.

Copy link
Contributor

commented Nov 2, 2012

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

@wesm wesm closed this Nov 2, 2012

@Lamarth

This comment has been minimized.

Copy link
Author

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
Projects
None yet
3 participants
You can’t perform that action at this time.