Skip to content

Commit 9d2ca98

Browse files
shriyakalakatapmhatre1
authored andcommitted
Fix PR07,RT03,SA01 errors for Index.append, Index.difference (pandas-dev#58453)
* Fix errors for Index.append * Fixed errors for Index.difference
1 parent 80e8940 commit 9d2ca98

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
--------
@@ -5173,10 +5183,18 @@ def append(self, other: Index | Sequence[Index]) -> Index:
51735183
Parameters
51745184
----------
51755185
other : Index or list/tuple of indices
5186+
Single Index or a collection of indices, which can be either a list or a
5187+
tuple.
51765188
51775189
Returns
51785190
-------
51795191
Index
5192+
Returns a new Index object resulting from appending the provided other
5193+
indices to the original Index.
5194+
5195+
See Also
5196+
--------
5197+
Index.insert : Make new Index inserting new item at location.
51805198
51815199
Examples
51825200
--------

0 commit comments

Comments
 (0)