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?
Just change the name property of the index.
libor.index.name = 'Date'
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With