You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation says that you can pass "label or list, or array-like". While pd.Index() might not be exactly an array-like, it does seem counterproductive to exclude the very thing that should be referenced when merging...
Feature Description
Simple request: Please expand allowable datastructures for right_on and left_on to be "label, list, array-like, or index".
Alternative Solutions
Temporary solution is to covert pd.Index to_lists():
loewenm
changed the title
ENH: allow pd.merge() variable right_on and left_on to accept pd.Index() array_likes
ENH: allow pd.merge() variables right_on and left_on to accept pd.Index() array_likes
Apr 16, 2024
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
When passing a Pandas Index as a variable in either right_on or left_on in a pd.merge(), the result is a KeyError
KeyError: array(['label 1', 'label 2', 'label 3'], dtype=object)
The documentation says that you can pass "label or list, or array-like". While pd.Index() might not be exactly an array-like, it does seem counterproductive to exclude the very thing that should be referenced when merging...
Feature Description
Simple request: Please expand allowable datastructures for right_on and left_on to be "label, list, array-like, or index".
Alternative Solutions
Temporary solution is to covert pd.Index to_lists():
Additional Context
I believe this probably just a simple "oh-yeah" moment...
The text was updated successfully, but these errors were encountered: