Skip to content

itertuples() fails after selecting a column twice #3873

Closed
@gtakacs

Description

@gtakacs

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)].

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions