diff --git a/pandas/_libs/index.pyx b/pandas/_libs/index.pyx index e6f59f8518754..f9e382285b408 100644 --- a/pandas/_libs/index.pyx +++ b/pandas/_libs/index.pyx @@ -321,6 +321,9 @@ cdef class IndexEngine: if is_strict_monotonic: self.unique = 1 self.need_unique_check = 0 + elif self.monotonic_inc == 1 or self.monotonic_dec == 1: + self.unique = 0 + self.need_unique_check = 0 cdef _call_monotonic(self, values): return algos.is_monotonic(values, timelike=False)