This code outputs dates along with values as a series. I wanted to manipulate the values but I ended up losing the dates.
rgdp = fred.get_series('GDPC1')
fgdp=rgdp
rlistgdp=[]
for a in range(len(rgdp)):
rgdp2=((rgdp.iloc[a]/rgdp.iloc[a-1])**4-1) * 100
rlistgdp.append(rgdp2)
rlistgdp
How can I keep the dates along with the new values?