Skip to content

Series to_string does not show index name #5734

Closed
@cancan101

Description

@cancan101

The standard repr for a Series shows the index name:

repr(pd.Series([1], index=pd.Index(["a"], name="idx")))
idx
a      1
dtype: int64

but to_string does not:

pd.Series([1], index=pd.Index(["a"], name="idx")).to_string(name=True)
a      1

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions