diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 8f6c5e0beee0b..7ffd2b72cb08d 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -88,8 +88,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.DataFrame.var PR01,RT03,SA01" \ -i "pandas.Grouper PR02" \ -i "pandas.Index PR07" \ - -i "pandas.Index.append PR07,RT03,SA01" \ - -i "pandas.Index.difference PR07,RT03,SA01" \ -i "pandas.Index.get_indexer PR07,SA01" \ -i "pandas.Index.get_indexer_for PR01,SA01" \ -i "pandas.Index.get_indexer_non_unique PR07,SA01" \ diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index c83dd3be13424..101fddb796e7a 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -3261,6 +3261,8 @@ def difference(self, other, sort=None): Parameters ---------- other : Index or array-like + Index object or an array-like object containing elements to be compared + with the elements of the original Index. sort : bool or None, default None Whether to sort the resulting index. By default, the values are attempted to be sorted, but any TypeError from @@ -3274,6 +3276,14 @@ def difference(self, other, sort=None): Returns ------- Index + Returns a new Index object containing elements that are in the original + Index but not in the `other` Index. + + See Also + -------- + Index.symmetric_difference : Compute the symmetric difference of two Index + objects. + Index.intersection : Form the intersection of two Index objects. Examples -------- @@ -5156,10 +5166,18 @@ def append(self, other: Index | Sequence[Index]) -> Index: Parameters ---------- other : Index or list/tuple of indices + Single Index or a collection of indices, which can be either a list or a + tuple. Returns ------- Index + Returns a new Index object resulting from appending the provided other + indices to the original Index. + + See Also + -------- + Index.insert : Make new Index inserting new item at location. Examples --------