Change column names in dataframe

In [1]:
import pandas as pd
df = pd.DataFrame([['AA', 1, 'a'],['BB', 2, 'a'],['CC', 3, 'a']], columns = ['name','value','salue'])

In [2]:
df


Out[2]:
name value salue
0 AA 1 a
1 BB 2 a
2 CC 3 a

In [3]:
df.columns.values[1:] = ['prefix_' + val for val in df.columns.values[1:]]

In [4]:
df.columns.values


Out[4]:
array(['name', 'prefix_value', 'prefix_salue'], dtype=object)

In [5]:
df


Out[5]:
name prefix_value prefix_salue
0 AA 1 a
1 BB 2 a
2 CC 3 a

In [ ]: