# add prefix to all columns except the first 3 df.columns = ['prefix_' + i if (ix > 2) else i for ix, i in enumerate(df.columns)]