Skip to content

ENH: set_index drops index name #6452

Closed
@jseabold

Description

@jseabold

Index

df = pd.util.testing.makeDataFrame()
df.index.name = 'name'
df.set_index(df.index)
df.set_index(df.index).index.names

MultiIndex

from statsmodels.datasets import grunfeld
data = sm.datasets.grunfeld.load_pandas().data
data = data.set_index(['firm', 'year'])
data.set_index(data.index).index.names

Version

[~/]
[33]: pd.version.version
[33]: '0.13.1-254-g150f323'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions