Skip to content

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

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
ghost opened this issue Nov 11, 2012 · 0 comments
Closed
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Nov 11, 2012

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")
@wesm wesm closed this as completed Nov 13, 2012
wesm added a commit that referenced this issue Nov 13, 2012
* y-p/fix1:
  ENH: warn user when invoking to_dict() on df with non-unique columns
  BUG: modify df.iteritems to support duplicate column labels #2219
  TST: df.iteritems() should yield Series even with non-unique column labels
  BUG: df with dupe cols should raise KeyError on accessing non-existent col via list #2218
  TST: df with dupe cols should raise KeyError on accessing non-existent col via list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant