First, move the non-date columns in to the index, then use replace and reset_index:
df = df.set_index('CashFlows')
df = df.rename(columns=lambda x: 'year_'+str(x.year))
First, move the non-date columns in to the index, then use replace and reset_index:
df = df.set_index('CashFlows')
df = df.rename(columns=lambda x: 'year_'+str(x.year))