This is related to https://github.com/pandas-dev/pandas/issues/12766 Possibly a duplicate.

A small, complete example of the issue

DD = pd.DataFrame({'A':[1,2,3,4,5]})
DD.index.name = 'Test'
print DD.index.name
DD.index = DD.index.map(unicode)
print DD.index.name

Expected Output

The mapping operation deletes the index name.

However mapping a function on the index means modifying an existing index, so one would expect the name of the index to stay the same as opposed to when choosing a completely new index.

Output of pd.show_versions()

python: 2.7.12.final.0
pandas: 0.19.0

EDIT:

Doing a set_index(column) does NOT set the column name as the index name, I think it would be common sense that the name of the column which becomes the new index be automatically set as the index name.

Comment From: jorisvandenbossche

This is indeed because of #12766. The Index.map returns an array, which does not hold the index name. So setting the index to that array, will result in an index without name. The fix here is to have Index.map return an Index, which can keep the original name -> #12766

Comment From: jorisvandenbossche

Regarding your other question, set_index does use the column name for the index name:

In [43]: df = pd.DataFrame({'a':[1,2,3], 'b': [4,5,6]})

In [44]: df
Out[44]: 
   a  b
0  1  4
1  2  5
2  3  6

In [45]: df.set_index('a')
Out[45]: 
   b
a   
1  4
2  5
3  6

In [46]: df.set_index('a').index.name
Out[46]: 'a'

In [47]: df.set_index(df['a']).index.name
Out[47]: 'a'

Do you have an example where this is not the case?

Comment From: jorisvandenbossche

Going to close this one, the actual issue will be solved once #12766 is fixed