Skip to content

Commit a240a73

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

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pandas/_libs/period.pyx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,8 @@ 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, other, op)
715717
# index/series like
716718
elif hasattr(other, '_typ'):
717719
return NotImplemented

0 commit comments

Comments
 (0)