pydata/pandas — pull request #4718 by jtratner (2013-08-31 23:24:53+00:00)
Title: ENH: Better rename/set_names handling for Index

Fixes #4628

* MultiIndex now responds correctly to ``rename`` (synonym for
``set_names``)
* ``set_names`` checks that input is list like.
* Cleaner error message for immutable ops.
* Added in previously missing tests for MultiIndex immutable metadata.
* Altered ``is_list_like`` to check for binary_types as well.

For now, this is the behavior for Index.rename. It's simple and clear and lets existing code just work instead of dealing with typechecks:

```python
In [2]: ind = Index(range(10))

In [3]: ind = ind.rename((u'A', u'B'))

In [4]: ind.name
Out[4]: (u'A', u'B')

In [5]: ind.names
Out[5]: FrozenList([(u'A', u'B')])
```