Skip to content

Commit

Permalink
Fix PR07,RT03,SA01 errors for Index.union, Index.symmetric_difference (
Browse files Browse the repository at this point in the history
…pandas-dev#58457)

* Fix PR07,RT03,SA01 errors for Index.union, Index.symmetric_difference

* Update pandas/core/indexes/base.py

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>

---------

Co-authored-by: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com>
  • Loading branch information
2 people authored and pmhatre1 committed May 7, 2024
1 parent b84e295 commit 27e3469
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
2 changes: 0 additions & 2 deletions ci/code_checks.sh
Expand Up @@ -106,9 +106,7 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Index.ravel PR01,RT03" \
-i "pandas.Index.slice_indexer PR07,RT03,SA01" \
-i "pandas.Index.str PR01,SA01" \
-i "pandas.Index.symmetric_difference PR07,RT03,SA01" \
-i "pandas.Index.take PR01,PR07" \
-i "pandas.Index.union PR07,RT03,SA01" \
-i "pandas.Index.view GL08" \
-i "pandas.Int16Dtype SA01" \
-i "pandas.Int32Dtype SA01" \
Expand Down
21 changes: 21 additions & 0 deletions pandas/core/indexes/base.py
Expand Up @@ -2872,6 +2872,8 @@ def union(self, other, sort=None):
Parameters
----------
other : Index or array-like
Index or an array-like object containing elements to form the union
with the original Index.
sort : bool or None, default None
Whether to sort the resulting Index.
Expand All @@ -2888,6 +2890,14 @@ def union(self, other, sort=None):
Returns
-------
Index
Returns a new Index object with all unique elements from both the original
Index and the `other` Index.
See Also
--------
Index.unique : Return unique values in the index.
Index.intersection : Form the intersection of two Index objects.
Index.difference : Return a new Index with elements of index not in `other`.
Examples
--------
Expand Down Expand Up @@ -3312,7 +3322,10 @@ def symmetric_difference(self, other, result_name=None, sort=None):
Parameters
----------
other : Index or array-like
Index or an array-like object with elements to compute the symmetric
difference with the original Index.
result_name : str
A string representing the name of the resulting Index, if desired.
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 @@ -3326,6 +3339,14 @@ def symmetric_difference(self, other, result_name=None, sort=None):
Returns
-------
Index
Returns a new Index object containing elements that appear in either the
original Index or the `other` Index, but not both.
See Also
--------
Index.difference : Return a new Index with elements of index not in other.
Index.union : Form the union of two Index objects.
Index.intersection : Form the intersection of two Index objects.
Notes
-----
Expand Down

0 comments on commit 27e3469

Please sign in to comment.