Skip to content

How should DataFrame.isin() handle DataFrame input? #7158

Closed
@cpcloud

Description

@cpcloud
n = 5
df = DataFrame({'a': randint(3, size=n),
                'b': randn(n)})
df2 = DataFrame({'a': randint(4, size=n),
                 'b': df.b + (rand(n) > 0.5).astype(float)})
df.isin(df2)

yields

a b
0 False True
1 False True
2 False False
3 False False
4 False True

I might expect it to go column by column calling isin on the intersection of the columns. I'm not sure if this was ever defined when DataFrame.isin() was implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignEnhancementIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions