diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 26c8ae1298630..1f21f48c061e1 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -113,8 +113,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Index.get_indexer_non_unique PR07,SA01" \ -i "pandas.Index.get_loc PR07,RT03,SA01" \ -i "pandas.Index.identical PR01,SA01" \ - -i "pandas.Index.insert PR07,RT03,SA01" \ - -i "pandas.Index.intersection PR07,RT03,SA01" \ -i "pandas.Index.join PR07,RT03,SA01" \ -i "pandas.Index.names GL08" \ -i "pandas.Index.nunique RT03" \ diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 9acab2642f6be..b6398bc0e9085 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -3082,6 +3082,8 @@ def intersection(self, other, sort: bool = False): Parameters ---------- other : Index or array-like + An Index or an array-like object containing elements to form the + intersection with the original Index. sort : True, False or None, default False Whether to sort the resulting index. @@ -3093,6 +3095,14 @@ def intersection(self, other, sort: bool = False): Returns ------- Index + Returns a new Index object with elements common to both the original Index + and the `other` Index. + + See Also + -------- + Index.union : Form the union of two Index objects. + Index.difference : Return a new Index with elements of index not in other. + Index.isin : Return a boolean array where the index values are in values. Examples -------- @@ -6624,11 +6634,19 @@ def insert(self, loc: int, item) -> Index: Parameters ---------- loc : int + The integer location where the new item will be inserted. item : object + The new item to be inserted into the Index. Returns ------- Index + Returns a new Index object resulting from inserting the specified item at + the specified location within the original Index. + + See Also + -------- + Index.append : Append a collection of Indexes together. Examples --------