Skip to content

Commit 5786f14

Browse files
DOC: Enforce Numpy Docstring Validation for pandas.IntervalIndex.right (#58650)
* DOC: add GL08 for pandas.IntervalIndex.right * DOC: remove GL08 for pandas.IntervalIndex.right * DOC: add GL08 for pandas.IntervalIndex.right * DOC: add GL08 for pandas.IntervalIndex.right
1 parent d2a6e42 commit 5786f14

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

ci/code_checks.sh

-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8282
-i "pandas.IntervalIndex.left GL08" \
8383
-i "pandas.IntervalIndex.length GL08" \
8484
-i "pandas.IntervalIndex.mid GL08" \
85-
-i "pandas.IntervalIndex.right GL08" \
8685
-i "pandas.IntervalIndex.set_closed RT03,SA01" \
8786
-i "pandas.IntervalIndex.to_tuples RT03,SA01" \
8887
-i "pandas.MultiIndex PR01" \

pandas/core/indexes/interval.py

+33
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,39 @@ def left(self) -> Index:
832832

833833
@cache_readonly
834834
def right(self) -> Index:
835+
"""
836+
Return right bounds of the intervals in the IntervalIndex.
837+
838+
The right bounds of each interval in the IntervalIndex are
839+
returned as an Index. The datatype of the right bounds is the
840+
same as the datatype of the endpoints of the intervals.
841+
842+
Returns
843+
-------
844+
Index
845+
An Index containing the right bounds of the intervals.
846+
847+
See Also
848+
--------
849+
IntervalIndex.left : Return the left bounds of the intervals
850+
in the IntervalIndex.
851+
IntervalIndex.mid : Return the mid-point of the intervals in
852+
the IntervalIndex.
853+
IntervalIndex.length : Return the length of the intervals in
854+
the IntervalIndex.
855+
856+
Examples
857+
--------
858+
>>> iv_idx = pd.IntervalIndex.from_arrays([1, 2, 3], [4, 5, 6], closed="right")
859+
>>> iv_idx.right
860+
Int64Index([4, 5, 6], dtype='int64')
861+
862+
>>> iv_idx = pd.IntervalIndex.from_tuples(
863+
... [(1, 4), (2, 5), (3, 6)], closed="left"
864+
... )
865+
>>> iv_idx.right
866+
Int64Index([4, 5, 6], dtype='int64')
867+
"""
835868
return Index(self._data.right, copy=False)
836869

837870
@cache_readonly

0 commit comments

Comments
 (0)