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.iteritems() should yield Series even with non-unique column labels #2219

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

df.iteritems() should yield Series even with non-unique column labels #2219

ghost opened this issue Nov 11, 2012 · 3 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Nov 11, 2012

df=DataFrame([[1,2,3],[4,5,6]],columns=['a','a','b'])
for k,v in df.iteritems():
    self.assertEqual(type(v),Series)
@ghost ghost mentioned this issue Nov 11, 2012
@lodagro
Copy link
Contributor

lodagro commented Nov 11, 2012

see also #2047

@ghost
Copy link
Author

ghost commented Nov 11, 2012

Thank you, I missed that and was unaware of df.icol()

@ghost
Copy link
Author

ghost commented Nov 11, 2012

#2228, #2227 make icol unsuitable right now, though it's the natural mechanism to use.

@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
yarikoptic added a commit to neurodebian/pandas that referenced this issue Nov 15, 2012
* commit 'v0.9.1rc1-27-ge374f0f': (52 commits)
  BUG: axes.color_cycle from mpl rcParams should not be joined as single string
  BUG: icol duplicate columns with integer sequence failure. close pandas-dev#2228
  TST: unit test for pandas-dev#2214
  BUG: coerce ndarray dtype to object when comparing series
  ENH: make vbench_suite/run_suite executable
  ENH: Use __file__ to determine REPO_PATH in vb_suite/suite.py
  BUG: 1 ** NA issue in computing new fill value in SparseSeries. close pandas-dev#2220
  BUG: make inplace semantics of DataFrame.where consistent. pandas-dev#2230
  BUG: fix internal error in constructing DataFrame.values with duplicate column names. close pandas-dev#2236
  added back mask method that does condition inversion added condition testing to where that raised ValueError on an invalid condition (e.g. not an ndarray like object) added tests for same
  in core/frame.py
  TST: getting column from and applying op to a df should commute
  TST: add dual ( x op y <-> y op x ) tests for arith operators
  BUG: Incorrect error message due to zero based levels. close pandas-dev#2226
  fixed file modes for core/frame.py, test/test_frame.py
  relaxed __setitem__ restriction on boolean indexing a frame on an equal sized frame
  in core/frame.py
  ENH: warn user when invoking to_dict() on df with non-unique columns
  BUG: modify df.iteritems to support duplicate column labels pandas-dev#2219
  TST: df.iteritems() should yield Series even with non-unique column labels
  ...
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

2 participants