Hi,
fetch_csv() says it can only be called from initialize()
I would like to organize a set of library functions one for each data I would like to support
For example, the following library function pulls in CPI data.
def get_quandl_cpi():
fetch_csv('https://www.quandl.com/api/v1/datasets/FRED/CPIAUCSL.csv',
symbol='Consumer_Price_Index',
date_column='Date',
pre_func=reformat_quandl_cpi)
def reformat_quandl_cpi(df):
frame = pd.DataFrame(
df.Value.values,
index=df.Date.apply(lambda dt: pd.Timestamp(dt, tz='utc')),
columns=['price']
)
index = pd.DatetimeIndex(
start=frame.index.min(),
end=frame.index.max(),
freq='D'
)
frame = frame.reindex(index).ffill()
frame['Date'] = frame.index
return frame
But when I try calling this from initialize(), there is an error that fetch_csv() is only supported from initialize, though in this case it is being called from another function that is being called from initialize.
Is this really intentional, that fetch_csv() can only be called directly from initialize() ?
Sarvi