Skip to content

Commit 66cfd80

Browse files
Fix PR07,RT03,SA01 errors for Index.append, Index.difference (#58453)
* Fix errors for Index.append * Fixed errors for Index.difference
1 parent cb8b213 commit 66cfd80

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
@@ -87,8 +87,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
8787
-i "pandas.DataFrame.var PR01,RT03,SA01" \
8888
-i "pandas.Grouper PR02" \
8989
-i "pandas.Index PR07" \
90-
-i "pandas.Index.append PR07,RT03,SA01" \
91-
-i "pandas.Index.difference PR07,RT03,SA01" \
9290
-i "pandas.Index.get_indexer PR07,SA01" \
9391
-i "pandas.Index.get_indexer_for PR01,SA01" \
9492
-i "pandas.Index.get_indexer_non_unique PR07,SA01" \

pandas/core/indexes/base.py

+18
Original file line numberDiff line numberDiff line change
@@ -3297,6 +3297,8 @@ def difference(self, other, sort=None):
32973297
Parameters
32983298
----------
32993299
other : Index or array-like
3300+
Index object or an array-like object containing elements to be compared
3301+
with the elements of the original Index.
33003302
sort : bool or None, default None
33013303
Whether to sort the resulting index. By default, the
33023304
values are attempted to be sorted, but any TypeError from
@@ -3310,6 +3312,14 @@ def difference(self, other, sort=None):
33103312
Returns
33113313
-------
33123314
Index
3315+
Returns a new Index object containing elements that are in the original
3316+
Index but not in the `other` Index.
3317+
3318+
See Also
3319+
--------
3320+
Index.symmetric_difference : Compute the symmetric difference of two Index
3321+
objects.
3322+
Index.intersection : Form the intersection of two Index objects.
33133323
33143324
Examples
33153325
--------
@@ -5192,10 +5202,18 @@ def append(self, other: Index | Sequence[Index]) -> Index:
51925202
Parameters
51935203
----------
51945204
other : Index or list/tuple of indices
5205+
Single Index or a collection of indices, which can be either a list or a
5206+
tuple.
51955207
51965208
Returns
51975209
-------
51985210
Index
5211+
Returns a new Index object resulting from appending the provided other
5212+
indices to the original Index.
5213+
5214+
See Also
5215+
--------
5216+
Index.insert : Make new Index inserting new item at location.
51995217
52005218
Examples
52015219
--------

0 commit comments

Comments
 (0)