Skip to content

Adding new rows drops index name #9857

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stared opened this issue Apr 11, 2015 · 3 comments
Closed

Adding new rows drops index name #9857

stared opened this issue Apr 11, 2015 · 3 comments
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Milestone

Comments

@stared
Copy link

stared commented Apr 11, 2015

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

@jreback jreback added Bug Indexing Related to indexing on series/frames, not to indexes themselves Reshaping Concat, Merge/Join, Stack/Unstack, Explode labels Apr 12, 2015
@jreback jreback added this to the Next Major Release milestone Apr 12, 2015
@jameshiebert
Copy link
Contributor

I'm looking that this one

@ksanghai
Copy link
Contributor

@jameshiebert I fixed this issue and is pending as PR #9876

@jreback jreback modified the milestones: 0.16.1, Next Major Release Apr 14, 2015
@jreback
Copy link
Contributor

jreback commented Apr 14, 2015

closed by #9876

@jreback jreback closed this as completed Apr 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Indexing Related to indexing on series/frames, not to indexes themselves Reshaping Concat, Merge/Join, Stack/Unstack, Explode
Projects
None yet
Development

No branches or pull requests

4 participants