Skip to content

BUG: Index with tuples comparison not working anymore #34123

Closed
@charlesdong1991

Description

@charlesdong1991

It seems trace back to #34081

with Index we could do something like:

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

And it's also possible to do the same for Index with tuples:

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

But seems not working this way anymore after #34081 , is this length check here correct (so it is designed this way on purpose)? or we should consider it a bug?

cc @jbrockmendel

currently master:

>>> pd.Index([('a', 'b'), ('b', 'c'), ('c', 'a')]) == ('c', 'a')
ValueError: ('Lengths must match', (3,), (2,), <class 'tuple'>)

Metadata

Metadata

Labels

BlockerBlocking issue or pull request for an upcoming releaseBugIndexRelated to the Index class or subclasses

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions