Skip to content
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

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

Closed
ghost opened this issue Nov 11, 2012 · 0 comments

Comments

@ghost
Copy link

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 Nov 13, 2012

wesm added a commit that referenced this issue Nov 13, 2012
Merge remote branch 'y-p/fix1'
* 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
Projects
None yet
1 participant
You can’t perform that action at this time.