Skip to content

ENH: Series.name should return a string or None #42550

Closed
@Dr-Irv

Description

@Dr-Irv

Is your feature request related to a problem?

Currently, the constructor for Series has the name argument as a str or None . But Series.name can return a Hashable, e.g., as a result of using DataFrame.xs() or .iloc on a row of a DataFrame.

So this is inconsistent. I think people expect the names of Series to be strings.

Describe the solution you'd like

Change the implementation of Series.name to return a string or None

API breaking implications

This is cleaning up the API, IMHO.

Describe alternatives you've considered

N/A

Additional context

ref: discussion in #42534

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocsSeriesSeries data structure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions