Skip to content

Instantly share code, notes, and snippets.

@flxai
Created March 13, 2021 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flxai/fe2cc29c3dc3c136cb79852327e1fa47 to your computer and use it in GitHub Desktop.
Save flxai/fe2cc29c3dc3c136cb79852327e1fa47 to your computer and use it in GitHub Desktop.
Get 10 year nominal yields on US government bonds from the Federal Reserve

These two lines download the 10 year nominal yields on US government bonds from the Federal Reserve. The 10 year government bond yield is considered a standard indicator of long-term interest rates. It was inspired by this repo.

url = "http://www.federalreserve.gov/datadownload/Output.aspx?rel=H15&series=0809abf197c17f1ff0b2180fe7015cc3&lastObs=&from=&to=&filetype=csv&label=include&layout=seriescolumn"
df = pd.read_csv(url, header=5, parse_dates=['Time Period'], index_col='Time Period')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment