From e3d8537c14e5d0e4e898cf26ecfd6952bd8a5491 Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Sun, 22 Sep 2024 12:52:35 +0530 Subject: [PATCH 1/2] DOC: fix SA01, ES01 for pandas.arrays.IntervalArray.mid --- ci/code_checks.sh | 1 - pandas/core/arrays/interval.py | 10 ++++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index f2d9f582d8932..5d33e2a113861 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -133,7 +133,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.arrays.IntegerArray SA01" \ -i "pandas.arrays.IntervalArray.left SA01" \ -i "pandas.arrays.IntervalArray.length SA01" \ - -i "pandas.arrays.IntervalArray.mid SA01" \ -i "pandas.arrays.IntervalArray.right SA01" \ -i "pandas.arrays.NumpyExtensionArray SA01" \ -i "pandas.arrays.SparseArray PR07,SA01" \ diff --git a/pandas/core/arrays/interval.py b/pandas/core/arrays/interval.py index 52d64162358c8..af3cbd4e134a7 100644 --- a/pandas/core/arrays/interval.py +++ b/pandas/core/arrays/interval.py @@ -1291,6 +1291,16 @@ def mid(self) -> Index: """ Return the midpoint of each Interval in the IntervalArray as an Index. + The midpoint of an interval is calculated as the average of its + `left` and `right` bounds. This property returns a `pandas.Index` object + containing the midpoint for each interval. + + See Also + -------- + Interval.left : Return left bound for the interval. + Interval.right : Return right bound for the interval. + Interval.length : Return the length of each interval. + Examples -------- From 55ff3efde29f1d82ae0355cbd8bb65cedeec78ff Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Wed, 25 Sep 2024 23:37:52 +0530 Subject: [PATCH 2/2] DOC: add double backticks for sphinx compatibility Co-authored-by: mroeschke --- pandas/core/arrays/interval.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/interval.py b/pandas/core/arrays/interval.py index af3cbd4e134a7..2ac9c77bef322 100644 --- a/pandas/core/arrays/interval.py +++ b/pandas/core/arrays/interval.py @@ -1292,7 +1292,7 @@ def mid(self) -> Index: Return the midpoint of each Interval in the IntervalArray as an Index. The midpoint of an interval is calculated as the average of its - `left` and `right` bounds. This property returns a `pandas.Index` object + ``left`` and ``right`` bounds. This property returns a ``pandas.Index`` object containing the midpoint for each interval. See Also