Skip to content

Commit 529bcc1

Browse files
DOC: Add GL08 for pandas.intervalIndex.left (#58687)
* DOC: add GL08 for pandas.IntervalIndex.left mroeschke * DOC: remove GL08 for pandas.IntervalIndex.left Co-authored-by: mroeschke * DOC: fix example for iv_idx.left
1 parent 9f7b3cc commit 529bcc1

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
@@ -76,7 +76,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
7676
-i "pandas.DataFrame.min RT03" \
7777
-i "pandas.DataFrame.plot PR02,SA01" \
7878
-i "pandas.Grouper PR02" \
79-
-i "pandas.IntervalIndex.left GL08" \
8079
-i "pandas.MultiIndex PR01" \
8180
-i "pandas.MultiIndex.append PR07,SA01" \
8281
-i "pandas.MultiIndex.copy PR07,RT03,SA01" \

pandas/core/indexes/interval.py

+33
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,39 @@ def _is_comparable_dtype(self, dtype: DtypeObj) -> bool:
842842

843843
@cache_readonly
844844
def left(self) -> Index:
845+
"""
846+
Return left bounds of the intervals in the IntervalIndex.
847+
848+
The left bounds of each interval in the IntervalIndex are
849+
returned as an Index. The datatype of the left bounds is the
850+
same as the datatype of the endpoints of the intervals.
851+
852+
Returns
853+
-------
854+
Index
855+
An Index containing the left bounds of the intervals.
856+
857+
See Also
858+
--------
859+
IntervalIndex.right : Return the right bounds of the intervals
860+
in the IntervalIndex.
861+
IntervalIndex.mid : Return the mid-point of the intervals in
862+
the IntervalIndex.
863+
IntervalIndex.length : Return the length of the intervals in
864+
the IntervalIndex.
865+
866+
Examples
867+
--------
868+
>>> iv_idx = pd.IntervalIndex.from_arrays([1, 2, 3], [4, 5, 6], closed="right")
869+
>>> iv_idx.left
870+
Index([1, 2, 3], dtype='int64')
871+
872+
>>> iv_idx = pd.IntervalIndex.from_tuples(
873+
... [(1, 4), (2, 5), (3, 6)], closed="left"
874+
... )
875+
>>> iv_idx.left
876+
Index([1, 2, 3], dtype='int64')
877+
"""
845878
return Index(self._data.left, copy=False)
846879

847880
@cache_readonly

0 commit comments

Comments
 (0)