For the first time, I'm unable to use the .shift()
method on a column of the DataFrame I'm working with, giving me a DataFrame' object is not callable
error.
sdf = quandl.get("AAII/AAII_SENTIMENT", authtoken="mytoken")
sdf = pd.DataFrame(data = sdf)
sdf = sdf.infer_objects()
sdf.index = pd.to_datetime(sdf.index, dayfirst=True)
sdf = sdf.iloc[9:,]
sdf['sp500_2w_future_close'] = sdf(['S&P 500 Weekly Close']).shift(-2)
I was expecting to get a new column displaying S&P 500 Weekly Close
two rows down and instead got this weird error. He, p please!