From 6b0410adb22086a66f838dfa84bdd1ae5b04a435 Mon Sep 17 00:00:00 2001 From: shriyakalakata Date: Sun, 28 Apr 2024 21:52:25 -0400 Subject: [PATCH 1/3] Fix errors for Index.join --- ci/code_checks.sh | 1 - pandas/core/indexes/base.py | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 26c8ae1298630..29a3f7fba3e51 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -115,7 +115,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Index.identical PR01,SA01" \ -i "pandas.Index.insert PR07,RT03,SA01" \ -i "pandas.Index.intersection PR07,RT03,SA01" \ - -i "pandas.Index.join PR07,RT03,SA01" \ -i "pandas.Index.names GL08" \ -i "pandas.Index.nunique RT03" \ -i "pandas.Index.putmask PR01,RT03" \ diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 9acab2642f6be..81d67600a0f14 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -4189,9 +4189,19 @@ def join( Parameters ---------- other : Index + An Index object to join with the original Index. how : {'left', 'right', 'inner', 'outer'} + Specifies the type of join to perform. It can take one of the following + values: + * 'left': Perform a left join, preserving the order of the original Index. + * 'right': Perform a right join. + * 'inner': Perform an inner join, retaining only the intersection of the i + ndices. + * 'outer': Perform an outer join, retaining all elements from both indices. level : int or level name, default None + Specifies the level of a multi-index, if applicable. return_indexers : bool, default False + A boolean indicating whether to return indexers. sort : bool, default False Sort the join keys lexicographically in the result Index. If False, the order of the join keys depends on the join type (how keyword). @@ -4199,6 +4209,12 @@ def join( Returns ------- join_index, (left_indexer, right_indexer) + The resulting Index after performing the join operation. + + See Also + -------- + Index.intersection : Form the intersection of two Index objects. + Index.append : Append a collection of Index options together. Examples -------- From e56d8c4ad947e2b2e6979947153311ed40894649 Mon Sep 17 00:00:00 2001 From: shriyakalakata Date: Tue, 30 Apr 2024 16:14:28 -0400 Subject: [PATCH 2/3] Slightly modify list --- pandas/core/indexes/base.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 9b30aca6a05ff..b1e75041ed333 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -4237,12 +4237,12 @@ def join( An Index object to join with the original Index. how : {'left', 'right', 'inner', 'outer'} Specifies the type of join to perform. It can take one of the following - values: - * 'left': Perform a left join, preserving the order of the original Index. - * 'right': Perform a right join. - * 'inner': Perform an inner join, retaining only the intersection of the i - ndices. - * 'outer': Perform an outer join, retaining all elements from both indices. + values. + * left : Perform a left join, preserving the order of the original Index. + * right : Perform a right join. + * inner : Perform an inner join, retaining only the intersection of the + indices. + * outer : Perform an outer join, retaining all elements from both indices. level : int or level name, default None Specifies the level of a multi-index, if applicable. return_indexers : bool, default False From cb640bffcf6baa1b542e424646956edac58ea5b2 Mon Sep 17 00:00:00 2001 From: shriyakalakata Date: Tue, 30 Apr 2024 16:18:16 -0400 Subject: [PATCH 3/3] Slightly modify list --- pandas/core/indexes/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index b1e75041ed333..8f8b835510b60 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -4254,7 +4254,7 @@ def join( Returns ------- join_index, (left_indexer, right_indexer) - The resulting Index after performing the join operation. + The resulting Index after performing the join operation. See Also --------