Skip to content

Commit

Permalink
Fix PR07,RT03,SA01 errors for Index.append, Index.difference (#58453)
Browse files Browse the repository at this point in the history
* Fix errors for Index.append

* Fixed errors for Index.difference
  • Loading branch information
shriyakalakata committed Apr 30, 2024
1 parent cb8b213 commit 66cfd80
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Expand Up @@ -87,8 +87,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.DataFrame.var PR01,RT03,SA01" \
-i "pandas.Grouper PR02" \
-i "pandas.Index PR07" \
-i "pandas.Index.append PR07,RT03,SA01" \
-i "pandas.Index.difference PR07,RT03,SA01" \
-i "pandas.Index.get_indexer PR07,SA01" \
-i "pandas.Index.get_indexer_for PR01,SA01" \
-i "pandas.Index.get_indexer_non_unique PR07,SA01" \
Expand Down
18 changes: 18 additions & 0 deletions pandas/core/indexes/base.py
Expand Up @@ -3297,6 +3297,8 @@ def difference(self, other, sort=None):
Parameters
----------
other : Index or array-like
Index object or an array-like object containing elements to be compared
with the elements of the original Index.
sort : bool or None, default None
Whether to sort the resulting index. By default, the
values are attempted to be sorted, but any TypeError from
Expand All @@ -3310,6 +3312,14 @@ def difference(self, other, sort=None):
Returns
-------
Index
Returns a new Index object containing elements that are in the original
Index but not in the `other` Index.
See Also
--------
Index.symmetric_difference : Compute the symmetric difference of two Index
objects.
Index.intersection : Form the intersection of two Index objects.
Examples
--------
Expand Down Expand Up @@ -5192,10 +5202,18 @@ def append(self, other: Index | Sequence[Index]) -> Index:
Parameters
----------
other : Index or list/tuple of indices
Single Index or a collection of indices, which can be either a list or a
tuple.
Returns
-------
Index
Returns a new Index object resulting from appending the provided other
indices to the original Index.
See Also
--------
Index.insert : Make new Index inserting new item at location.
Examples
--------
Expand Down

0 comments on commit 66cfd80

Please sign in to comment.