Skip to content

engine='python' df.to_csv() duplicate columns doesn't work #3457

Closed
@ghost

Description

example from 0.10.1, and carried on to to_csv(engine='python') in 0.11

note the first columns duplicates the second columns, which shouldn't be.

Corrolary #3454

from pandas.util.testing import makeCustomDataframe as mkdf

N=10
df= mkdf(N, 3)
df.columns = ['a','a','b']
path = "/tmp/k.csv"
df.to_csv("/tmp/k.csv")
!cat "/tmp/k.csv"
R0,a,a,b
R_l0_g0,R0C1,R0C1,R0C2
R_l0_g1,R1C1,R1C1,R1C2
R_l0_g10,R2C1,R2C1,R2C2
R_l0_g2,R3C1,R3C1,R3C2
R_l0_g3,R4C1,R4C1,R4C2
R_l0_g4,R5C1,R5C1,R5C2
R_l0_g5,R6C1,R6C1,R6C2
R_l0_g6,R7C1,R7C1,R7C2
R_l0_g7,R8C1,R8C1,R8C2
R_l0_g8,R9C1,R9C1,R9C2

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIO DataIO issues that don't fit into a more specific label

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions