Skip to content

DataFrame.loc[] loses index name #3880

Closed
@joeb1415

Description

@joeb1415
In [1]: from pandas import DataFrame

In [2]: x = DataFrame([[1, 1], [1, 1]])

In [3]: x.index.name = 'index_name'

In [4]: x.iloc[[0, 1]].index.name
Out[4]: 'index_name'

In [5]: x.loc[[0, 1]].index.name

In [6]: x.loc[[0, 1]].index.name is None
Out[6]: True

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselves

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions