Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BUG: join unexpectedly created extra column start with "key_" #61294

Copy link
Copy link
Open
@albb318

Description

@albb318
Issue body actions

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

import pandas as pd

a = pd.DataFrame({0:[1,2,3]})
b = pd.DataFrame(index=[1,2,3],data={0:[4,5,6]})
a.join(b, on=0, rsuffix='_test')

Issue Description

When dataframe a and b have the same column name, a key_ column is created unexpectedly after the join operation.

key_0 0 0_test
0 1 1 4
1 2 2 5
2 3 3 6

Expected Behavior

Expecting result without the key_0 column.

Installed Versions

pandas : 2.2.3
numpy : 1.26.4

Metadata

Metadata

Assignees

Labels

BugDeprecateFunctionality to remove in pandasFunctionality to remove in pandasReshapingConcat, Merge/Join, Stack/Unstack, ExplodeConcat, Merge/Join, Stack/Unstack, Explode

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.