You can use the add_prefix() function of Pandas DataFrame. This function adds a prefix to labels for Series and columns for DataFrame.
Here is an example:
>>> import pandas as pd>>> df = pd.DataFrame({'A':[1,2,3],'B':[11,12,13]})>>> df A B0 1 111 2 122 3 13>>> df.add_prefix('col_') col_A col_B0 1 111 2 122 3 13
>>> import pandas as pd
>>> df = pd.DataFrame({'A':[1,2,3],'B':[11,12,13]})
>>> df
A B
0 1 11
1 2 12
2 3 13
>>> df.add_prefix('col_')
col_A col_B