Let say I have below data frame:
import pandas as pd
raw_data = {'col1': [23,45,21,45,23],'col2': [3,4,5,22,3],'col3': ['y1', 'y2', 'y3', 'y1', 'y2'],'col4': ['x1', 'x2', 'x3', 'x1', 'x2']}
df = pd.DataFrame(raw_data, columns = ['col1','col2','col3','col4','col5'])
Now I want to prefix 'PRE-' to each column names except 'col2' and 'col4' in a programmatic way.
Is there any method/function available to achieve this?
Thanks for your pointer