Adding new rows drops index name · Issue #9857 · pandas-dev/pandas (original) (raw)
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