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

itertuples() fails after selecting a column twice #3873

Closed
gtakacs opened this issue Jun 12, 2013 · 1 comment · Fixed by #3879
Closed

itertuples() fails after selecting a column twice #3873

gtakacs opened this issue Jun 12, 2013 · 1 comment · Fixed by #3879
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Milestone

Comments

@gtakacs
Copy link

gtakacs commented Jun 12, 2013

The following code gives incorrect result (using pandas 0.11):

import pandas
df = pandas.DataFrame(data={"a": [1, 2, 3], "b": [4, 5, 6]})
print df[["a", "a"]].values # works
print list(df[["a", "a"]].itertuples()) # FAILS!

The last lines prints [(0, 'a', 'a'), (1, 'a', 'a')] instead of [(0, 1, 1), (1, 2, 2), (2, 3, 3)].

@cpcloud
Copy link
Member

cpcloud commented Jun 12, 2013

i can repro this...prolly a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants