-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Bug: Incorrect IntervalIndex.is_overlapping #49933
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
Conversation
pandas/_libs/intervaltree.pxi.in
Outdated
@@ -81,7 +81,9 @@ cdef class IntervalTree(IntervalMixin): | |||
"""How to sort the left labels; this is used for binary search | |||
""" | |||
if self._left_sorter is None: | |||
self._left_sorter = np.argsort(self.left) | |||
left_right = np.asarray([(self.left[i], self.right[i]) for i in range(0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks likely to be non-performant. can we maybe check for uniqueness and only do this in the non-unique case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds like a more decent solution. Actually, I'm a first-time contributor here, so I'm wondering what to do next. Do I have to close the PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can push a new commit to update your pull request with the changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think elsewhere in the file we use np.lexsort([self.left, self.right])
which should be similar to this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sound like a much better way for sorting, and I have made these changes in my latest commit.
Also, is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you remove pandas/_libs/intervaltree.pxi.pdf
?
@mroeschke Fixed. Edit: Strangely it fails the "Python Dev / actions-311-dev (macOS-latest) (pull_request)" integration test. |
I've removed this file, is there any thing I've to do now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Merge when ready @jbrockmendel
thanks @Hikipeko |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.