Skip to content

Commit 8447d52

Browse files
committed
implement
1 parent 96f3e7c commit 8447d52

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

pandas/core/indexes/base.py

+32
Original file line numberDiff line numberDiff line change
@@ -1202,6 +1202,38 @@ def is_monotonic_decreasing(self):
12021202
"""
12031203
return self._engine.is_monotonic_decreasing
12041204

1205+
@property
1206+
def is_strictly_monotonic_increasing(self):
1207+
"""return if the index is strictly monotonic increasing
1208+
(only increasing) values
1209+
1210+
Examples
1211+
--------
1212+
>>> Index([1, 2, 3]).is_strictly_monotonic_increasing
1213+
True
1214+
>>> Index([1, 2, 2]).is_strictly_monotonic_increasing
1215+
False
1216+
>>> Index([1, 3, 2]).is_strictly_monotonic_increasing
1217+
False
1218+
"""
1219+
return self.is_unique and self.is_monotonic_increasing
1220+
1221+
@property
1222+
def is_strictly_monotonic_decreasing(self):
1223+
"""return if the index is strictly monotonic decreasing
1224+
(only decreasing) values
1225+
1226+
Examples
1227+
--------
1228+
>>> Index([3, 2, 1]).is_strictly_monotonic_decreasing
1229+
True
1230+
>>> Index([3, 2, 2]).is_strictly_monotonic_decreasing
1231+
False
1232+
>>> Index([3, 1, 2]).is_strictly_monotonic_decreasing
1233+
False
1234+
"""
1235+
return self.is_unique and self.is_monotonic_decreasing
1236+
12051237
def is_lexsorted_for_tuple(self, tup):
12061238
return True
12071239

0 commit comments

Comments
 (0)