aboutsummaryrefslogtreecommitdiffstats
path: root/python/yieldcurve.py
diff options
context:
space:
mode:
Diffstat (limited to 'python/yieldcurve.py')
-rw-r--r--python/yieldcurve.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/python/yieldcurve.py b/python/yieldcurve.py
index 2dadf311..b426c6cc 100644
--- a/python/yieldcurve.py
+++ b/python/yieldcurve.py
@@ -13,9 +13,9 @@ import matplotlib.pyplot as plt
def getMarkitIRData(date = datetime.date.today()):
basedir = os.path.join(root, "data", "Yield Curves")
- filename = "InterestRates_USD_{%Y%m%d}.xml".format(date)
+ filename = "InterestRates_USD_{0:%Y%m%d}.xml".format(date)
if not os.path.exists(os.path.join(basedir, filename)):
- r = requests.get('http://www.markit.com/news/InterestRates_USD_{%Y%m%d}.zip'.format(date))
+ r = requests.get('http://www.markit.com/news/InterestRates_USD_{0:%Y%m%d}.zip'.format(date))
if "x-zip" in r.headers['content-type']:
with zipfile.ZipFile(BytesIO(r.content)) as z:
z.extractall(path = os.path.join(root, "data", "Yield Curves"))
@@ -37,7 +37,7 @@ def getMarkitIRData(date = datetime.date.today()):
def get_futures_data(date = datetime.date.today()):
futures_file = os.path.join(root, "data", "Yield Curves",
- "futures-{%Y-%m-%d}.csv".format(date)
+ "futures-{0:%Y-%m-%d}.csv".format(date)
with open(futures_file) as fh:
quotes = [float(line.split(",")[1]) for line in fh]
return quotes