In [2]:
df
Out[2]:
a b c
0 4.0 7 10.0
1 5.0 8 11.0
2 NaN 9 NaN

Change names of specific columns.

In [3]:
df.rename(columns={"a":"A", "b":"B"})
df.rename({"a":"A", "b":"B"}, axis="columns")
df.rename({"a":"A", "b":"B"}, axis=1)
Out[3]:
A B c
0 4.0 7 10.0
1 5.0 8 11.0
2 NaN 9 NaN

Change columns names using a function.

In [4]:
df.rename(columns=str.upper)
df.rename(mapper=str.upper, axis='columns')
df.rename(mapper=str.upper, axis=1)
Out[4]:
A B C
0 4.0 7 10.0
1 5.0 8 11.0
2 NaN 9 NaN

Rename column and index labels.

In [5]:
df.rename(columns={"a":"A", "b":"B", "c":"C"}, 
          index={0:10, 1:20, 2:30})
df.rename(columns=str.upper, 
          index=lambda x: (x + 1) *  10)
Out[5]:
A B C
10 4.0 7 10.0
20 5.0 8 11.0
30 NaN 9 NaN