4

I'm trying to rename the index of a series libor I have from DATE to Date:

libor.rename(index={"DATE": "Date"})

The result is unforunately the same as it went in though:

            VALUE
DATE    
1986-01-02  8.12500
1986-01-03  8.12500
1986-01-06  8.18750

I was hoping that 'DATE' would become 'Date'. I'm trying to multiply it with a Dataframe with a 'Date' index, on a column-by-column basis.

How can I rename the index?

1
  • 1
    Did you pass inplace=True? Commented May 11, 2016 at 13:45

2 Answers 2

6

Just change the name property of the index.

libor.index.name = 'Date'
Sign up to request clarification or add additional context in comments.

Comments

3

you can use rename_axis() for that:

Example:

In [310]: s
Out[310]:
Index
0    1
1    2
2    3
dtype: int64

In [312]: s = s.rename_axis('idx')

In [313]: s
Out[313]:
idx
0    1
1    2
2    3
dtype: int64

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.