Skip to content

Commit d20a922

Browse files
shriyakalakatamroeschke
authored andcommitted
Fix PR07,RT03,SA01 errors for Index.insert, Index.intersection (pandas-dev#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 cf6c2f5 commit d20a922

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
--------
@@ -6606,11 +6616,19 @@ def insert(self, loc: int, item) -> Index:
66066616
Parameters
66076617
----------
66086618
loc : int
6619+
The integer location where the new item will be inserted.
66096620
item : object
6621+
The new item to be inserted into the Index.
66106622
66116623
Returns
66126624
-------
66136625
Index
6626+
Returns a new Index object resulting from inserting the specified item at
6627+
the specified location within the original Index.
6628+
6629+
See Also
6630+
--------
6631+
Index.append : Append a collection of Indexes together.
66146632
66156633
Examples
66166634
--------

0 commit comments

Comments
 (0)