Skip to content

df with dupe cols should raise KeyError on accessing non-existent col via list #2218

Closed
@ghost

Description

from pandas import DataFrame
df=DataFrame([[1,2,3],[4,5,6]],columns=['a','a','b'])
try:
    df[['baf']]
except KeyError:
    pass
else:
    self.fail("Dataframe failed to raise KeyError")

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions