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.
Created
March 13, 2021 01:56
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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