Skip to content

Commit 2b23112

Browse files
jschendelPingviinituutti
authored andcommitted
DOC: Interval related doc fixes (pandas-dev#24780)
1 parent 8e2c5ff commit 2b23112

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

doc/source/api/indexing.rst

+1
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ IntervalIndex Components
258258
IntervalIndex.get_indexer
259259
IntervalIndex.set_closed
260260
IntervalIndex.overlaps
261+
IntervalIndex.to_tuples
261262

262263
.. _api.multiindex:
263264

pandas/core/arrays/interval.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
closed
7272
mid
7373
length
74-
values
7574
is_non_overlapping_monotonic
7675
%(extra_attributes)s\
7776
@@ -936,13 +935,16 @@ def mid(self):
936935
# datetime safe version
937936
return self.left + 0.5 * self.length
938937

939-
@property
940-
def is_non_overlapping_monotonic(self):
941-
"""
942-
Return True if the IntervalArray is non-overlapping (no Intervals share
938+
_interval_shared_docs['is_non_overlapping_monotonic'] = """
939+
Return True if the %(klass)s is non-overlapping (no Intervals share
943940
points) and is either monotonic increasing or monotonic decreasing,
944941
else False
945942
"""
943+
944+
@property
945+
@Appender(_interval_shared_docs['is_non_overlapping_monotonic']
946+
% _shared_docs_kwargs)
947+
def is_non_overlapping_monotonic(self):
946948
# must be increasing (e.g., [0, 1), [1, 2), [2, 3), ... )
947949
# or decreasing (e.g., [-1, 0), [-2, -1), [-3, -2), ...)
948950
# we already require left <= right
@@ -986,7 +988,7 @@ def __array__(self, dtype=None):
986988
Returns NA as a tuple if True, ``(nan, nan)``, or just as the NA
987989
value itself if False, ``nan``.
988990
989-
..versionadded:: 0.23.0
991+
.. versionadded:: 0.23.0
990992
991993
Returns
992994
-------

pandas/core/indexes/interval.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def _new_IntervalIndex(cls, d):
102102
summary="Immutable index of intervals that are closed on the same side.",
103103
name=_index_doc_kwargs['name'],
104104
versionadded="0.20.0",
105-
extra_attributes="is_overlapping\n",
105+
extra_attributes="is_overlapping\nvalues\n",
106106
extra_methods="contains\n",
107107
examples=textwrap.dedent("""\
108108
Examples
@@ -465,6 +465,8 @@ def is_unique(self):
465465
return self._multiindex.is_unique
466466

467467
@cache_readonly
468+
@Appender(_interval_shared_docs['is_non_overlapping_monotonic']
469+
% _index_doc_kwargs)
468470
def is_non_overlapping_monotonic(self):
469471
return self._data.is_non_overlapping_monotonic
470472

0 commit comments

Comments
 (0)