pydata/pandas — pull request #6459 by qwhelan (2014-02-24 04:28:11+00:00)
Title: ENH: Preserve .names in df.set_index(df.index)

Resolves #6452.

This causes a slight change in behavior in @jseabold's second example. Previously, ```df.set_index(df.index)``` would convert a ```MultiIndex``` into an ```Index``` of tuples:
```
In [7]: from statsmodels.datasets import grunfeld

In [8]: data = sm.datasets.grunfeld.load_pandas().data

In [9]: data = data.set_index(['firm', 'year'])

In [10]: data.set_index(data.index).index.names
Out[10]: [None]

In [11]: data
Out[11]:

MultiIndex: 220 entries, (General Motors, 1935.0) to (American Steel, 1954.0)
Data columns (total 3 columns):
invest 220 non-null values
value 220 non-null values
capital 220 non-null values
dtypes: float64(3)

In [13]: data.set_index(data.index)
Out[13]:

Index: 220 entries, (General Motors, 1935.0) to (American Steel, 1954.0)
Data columns (total 3 columns):
invest 220 non-null values
value 220 non-null values
capital 220 non-null values
dtypes: float64(3)
```

This change makes it so the index remains a ```MultiIndex```.