Pandas > Rename column

Name
Code
Output
dataframe = pandas.DataFrame(numpy.random.randint(0,100,size=(5, 2)), columns=['C1','C2'])
print ("dataframe")
print (dataframe)
# option without inplace will return new dataframe
dataframe.rename(columns={'C1':'C100'},inplace=True)
print ("dataframe renamed column")
print (dataframe)
dataframe
   C1  C2
0  65  42
1  37  12
2  84   3
3  42  54
4  55  45
dataframe renamed column
   C100  C2
0    65  42
1    37  12
2    84   3
3    42  54
4    55  45