Skip to content

Commit 2b52867

Browse files
committed
ENH: Support For Interval __contains__ Other Interval (pandas-dev#46613)
1 parent 98764bd commit 2b52867

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pandas/_libs/interval.pyx

+2-3
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,8 @@ cdef class Interval(IntervalMixin):
414414
if isinstance(key, Interval):
415415
return ((self.left < key.left if self.open_left and key.closed_left else self.left <= key.left) and
416416
(key.right < self.right if self.open_right and key.closed_right else key.right <= self.right))
417-
elif isinstance(key, _Timestamp) or is_timedelta64_object(key) or is_float_object(key) or is_integer_object(key):
418-
return ((self.left < key if self.open_left else self.left <= key) and
419-
(key < self.right if self.open_right else key <= self.right))
417+
return ((self.left < key if self.open_left else self.left <= key) and
418+
(key < self.right if self.open_right else key <= self.right))
420419

421420
def __richcmp__(self, other, op: int):
422421
if isinstance(other, Interval):

0 commit comments

Comments
 (0)