Skip to content

Commit 445fbe5

Browse files
committed
Decrease test_monotonic_inc by one order and change is_monotonic
1 parent 3826ebf commit 445fbe5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

asv_bench/benchmarks/index_object.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,13 @@ def time_get_loc(self):
184184
class IntervalIndexMethod(object):
185185
# GH 24813
186186
def setup(self):
187-
N = 10000
187+
N = 10**5
188188
left = np.append(np.arange(N), np.array(0))
189189
right = np.append(np.arange(1, N + 1), np.array(1))
190190
self.intv = IntervalIndex.from_arrays(left, right)
191191

192192
def time_monotonic_inc(self):
193193
self.intv.is_monotonic_increasing
194194

195+
195196
from .pandas_vb_common import setup # noqa: F401

pandas/core/indexes/interval.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def is_monotonic(self):
440440
Return True if the IntervalIndex is monotonic increasing (only equal or
441441
increasing values), else False
442442
"""
443-
return self._multiindex.is_monotonic
443+
return self.is_monotonic_increasing
444444

445445
@cache_readonly
446446
def is_monotonic_increasing(self):
@@ -458,8 +458,6 @@ def is_monotonic_increasing(self):
458458
# we have mixed types and np.lexsort is not happy
459459
return Index(self.values).is_monotonic
460460

461-
return self._multiindex.is_monotonic_increasing
462-
463461
@cache_readonly
464462
def is_monotonic_decreasing(self):
465463
"""

0 commit comments

Comments
 (0)