Skip to content

Commit 2a7ad2e

Browse files
Fix PR07,RT03,SA01 errors for Index.insert, Index.intersection (#58456)
* Fix PR07,RT03,SA01 errors for Index.insert, Index.intersection * Update pandas/core/indexes/base.py Co-authored-by: Matthew Roeschke <[email protected]> * Update pandas/core/indexes/base.py Co-authored-by: Matthew Roeschke <[email protected]> * Update pandas/core/indexes/base.py Co-authored-by: Matthew Roeschke <[email protected]> --------- Co-authored-by: Matthew Roeschke <[email protected]>
1 parent a2bce66 commit 2a7ad2e

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

ci/code_checks.sh

-2
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
111111
-i "pandas.Index.get_indexer_non_unique PR07,SA01" \
112112
-i "pandas.Index.get_loc PR07,RT03,SA01" \
113113
-i "pandas.Index.identical PR01,SA01" \
114-
-i "pandas.Index.insert PR07,RT03,SA01" \
115-
-i "pandas.Index.intersection PR07,RT03,SA01" \
116114
-i "pandas.Index.join PR07,RT03,SA01" \
117115
-i "pandas.Index.names GL08" \
118116
-i "pandas.Index.nunique RT03" \

pandas/core/indexes/base.py

+18
Original file line numberDiff line numberDiff line change
@@ -3082,6 +3082,8 @@ def intersection(self, other, sort: bool = False):
30823082
Parameters
30833083
----------
30843084
other : Index or array-like
3085+
An Index or an array-like object containing elements to form the
3086+
intersection with the original Index.
30853087
sort : True, False or None, default False
30863088
Whether to sort the resulting index.
30873089
@@ -3093,6 +3095,14 @@ def intersection(self, other, sort: bool = False):
30933095
Returns
30943096
-------
30953097
Index
3098+
Returns a new Index object with elements common to both the original Index
3099+
and the `other` Index.
3100+
3101+
See Also
3102+
--------
3103+
Index.union : Form the union of two Index objects.
3104+
Index.difference : Return a new Index with elements of index not in other.
3105+
Index.isin : Return a boolean array where the index values are in values.
30963106
30973107
Examples
30983108
--------
@@ -6625,11 +6635,19 @@ def insert(self, loc: int, item) -> Index:
66256635
Parameters
66266636
----------
66276637
loc : int
6638+
The integer location where the new item will be inserted.
66286639
item : object
6640+
The new item to be inserted into the Index.
66296641
66306642
Returns
66316643
-------
66326644
Index
6645+
Returns a new Index object resulting from inserting the specified item at
6646+
the specified location within the original Index.
6647+
6648+
See Also
6649+
--------
6650+
Index.append : Append a collection of Indexes together.
66336651
66346652
Examples
66356653
--------

0 commit comments

Comments
 (0)