pandas.Series.rename

Series.rename(mapper, inplace=False)

Alter Series index using dict or function

mapper : dict-like or function
Transformation to apply to each index

Function / dict values must be unique (1-to-1)

>>> x
foo 1
bar 2
baz 3
>>> x.rename(str.upper)
FOO 1
BAR 2
BAZ 3
>>> x.rename({'foo' : 'a', 'bar' : 'b', 'baz' : 'c'})
a 1
b 2
c 3

renamed : Series (new object)