Skip to content

Commit e69d711

Browse files
committed
PERF: perform a unique intersection with IntervalIndex if at least one side is unique
1 parent cdc07fd commit e69d711

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/core/indexes/interval.py

+2
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,8 @@ def overlaps(self, other):
11431143
def intersection(self, other, sort=False):
11441144
if self.left.is_unique and self.right.is_unique:
11451145
taken = self._intersection_unique(other)
1146+
elif other.left.is_unique and other.right.is_unique:
1147+
taken = other._intersection_unique(self)
11461148
else:
11471149
# duplicates
11481150
taken = self._intersection_non_unique(other)

0 commit comments

Comments
 (0)