Skip to content

to_string on DataFrame may print column labels in the wrong order #325

Closed
@craustin

Description

@craustin

d = {'a': [1,2,3], 'b':[4,5,6]}
from pandas import DataFrame
df = DataFrame(d)

df.to_string()

Returns:
a b
0 1 4
1 2 5
2 3 6

df.to_string(columns=['b','a'])

Returns:
a b
0 4 1
1 5 2
2 6 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions