Skip to content

BUG: Index formed with list of tuples return wrong output in eq ops #34180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
charlesdong1991 opened this issue May 14, 2020 · 1 comment · Fixed by #37170
Closed

BUG: Index formed with list of tuples return wrong output in eq ops #34180

charlesdong1991 opened this issue May 14, 2020 · 1 comment · Fixed by #37170
Labels
Bug Index Related to the Index class or subclasses MultiIndex
Milestone

Comments

@charlesdong1991
Copy link
Member

xref #34137

Currently

>>> pd.Index([('a', 'b'), ('b', 'c'), ('c', 'a')]) == ('c', 'a')
>>> array([False, False, False])

The issue is such case is treated as a MultiIndex other than plain Index.

Expected:

>>> pd.Index([('a', 'b'), ('b', 'c'), ('c', 'a')]) == ('c', 'a')
>>> array([False, False, True])
@charlesdong1991 charlesdong1991 added Bug Needs Triage Issue that has not been reviewed by a pandas team member Index Related to the Index class or subclasses MultiIndex and removed Needs Triage Issue that has not been reviewed by a pandas team member labels May 14, 2020
@asishm
Copy link
Contributor

asishm commented Sep 25, 2020

@charlesdong1991 It seems this is currently failing on master with ValueError: ('Lengths must match to compare', (3,), (2,))

jbrockmendel added a commit to jbrockmendel/pandas that referenced this issue Oct 18, 2020
@jreback jreback added this to the 1.2 milestone Oct 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Index Related to the Index class or subclasses MultiIndex
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants