Skip to content

Leading space in to_string(index=False) #11833

Closed
@varunkumar-dev

Description

@varunkumar-dev

#11750

In [2]: df = pd.DataFrame({'a':range(5)})

In [3]: df.to_string()
Out[3]: '   a\n0  0\n1  1\n2  2\n3  3\n4  4'

In [4]: df.to_string(index=False)
Out[4]: ' a\n 0\n 1\n 2\n 3\n 4'

What is the use of a leading space when index = False ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Output-Formatting__repr__ of pandas objects, to_string

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions