I am trying to source US Treasury Yield Data in order to approximate a risk-free rate which I would like to use in a Notebook. I've made some attempts and I have several questions.
Attempt 1: Try to see if the data already exists in quantopian.pipeline.data.quandl
Here I would like to know how one can check what data is available in this module. I can't seem to figure out whats in there. Is there perhaps a way to see what modules/data exist after importing quandl? I've tried the following:
from quantopian.pipeline.data import quandl dir(quandl) help(quandl)
Attempt 2: Use fetch_csv
I can't seem to use fetch_csv in the Notebook environment. How does one import this function? I've tried the following with error:
fetch_csv('https://www.quandl.com/api/v3/datasets/USTREASURY/YIELD.csv?api_key=MM5yxdNn66xWZVysGAQZ', date_column='Date', usecols=['3 MO'], date_format='%Y-%m-%d')
and received error: "NameError: name 'fetch_csv' is not defined"
Finally, how would I then refer to the csv file i.e. I would like to do the following:
df['yields'] = fetch_csv(...)