Skip to content

Adding new rows drops index name #9857

Closed
@stared

Description

@stared
df = pd.DataFrame({'x': [1,2,6], 'y': [2,2,8], 'z':[-5,0,5]})
df = df.set_index('z')

Then df.index.name is 'z'. After modifying an existing row

df.loc[5] = {'x': 9, 'y': 99}

it's still fine. But once we add a new index:

df.loc[10] = {'x': 7, 'y': 77}

df.index.name is None.

I use Pandas 0.16.0 on Python 3.4.

It might be related to another issue with disappearing index name: #9854

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIndexingRelated to indexing on series/frames, not to indexes themselvesReshapingConcat, Merge/Join, Stack/Unstack, Explode

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions