Skip to content

Commit c7a140e

Browse files
committed
BUG: Make Period and int comparable
1 parent bbf0dda commit c7a140e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/_libs/period.pyx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,10 @@ cdef class _Period(object):
712712
return PyObject_RichCompareBool(self.ordinal, other.ordinal, op)
713713
elif other is NaT:
714714
return _nat_scalar_rules[op]
715+
elif util.is_integer_object(other):
716+
return PyObject_RichCompareBool(self.ordinal,
717+
other * self.freq.n,
718+
op)
715719
# index/series like
716720
elif hasattr(other, '_typ'):
717721
return NotImplemented

0 commit comments

Comments
 (0)