Yield CurveΒΆ

[5]:
import QuantLib as ql
import matplotlib.pyplot as plt
[3]:
dates = [ql.Date(15,6,2020), ql.Date(15,6,2021), ql.Date(15,6,2022)]
zeros = [0.01, 0.02, 0.03]
curve = ql.ZeroCurve(dates, zeros, ql.ActualActual(), ql.TARGET())
[4]:
curve.nodes()
[4]:
((Date(15,6,2020), 0.01), (Date(15,6,2021), 0.02), (Date(15,6,2022), 0.03))
[15]:
plt.plot(*list(zip(*[(dt.to_date(), rate) for dt,rate in curve.nodes()])), marker='o')
[15]:
[<matplotlib.lines.Line2D at 0x7f6933e5ddf0>]
../../_images/examples_fixedincome_yieldcurve_4_1.svg
[ ]: