File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -448,6 +448,16 @@ def is_monotonic_increasing(self):
448
448
Return True if the IntervalIndex is monotonic increasing (only equal or
449
449
increasing values), else False
450
450
"""
451
+ values = [self .right , self .left ]
452
+
453
+ try :
454
+ sort_order = np .lexsort (values )
455
+ return Index (sort_order ).is_monotonic
456
+ except TypeError :
457
+
458
+ # we have mixed types and np.lexsort is not happy
459
+ return Index (self .values ).is_monotonic
460
+
451
461
return self ._multiindex .is_monotonic_increasing
452
462
453
463
@cache_readonly
@@ -456,7 +466,7 @@ def is_monotonic_decreasing(self):
456
466
Return True if the IntervalIndex is monotonic decreasing (only equal or
457
467
decreasing values), else False
458
468
"""
459
- return self . _multiindex . is_monotonic_decreasing
469
+ return self [:: - 1 ]. is_monotonic_increasing
460
470
461
471
@cache_readonly
462
472
def is_unique (self ):
You can’t perform that action at this time.
0 commit comments