我正在尝试运行下面的代码,但由于某种原因,在一台电脑上它运行正常,在第二台电脑上它失败并显示以下错误消息;1台电脑正常运行,第2台就失败的原因是什么?
代码来源:http://gouthamanbalaraman.com/blog/quantlib-bond-modeling.html
!pip install QuantLib
import QuantLib as ql
todaysDate = ql.Date(15, 1, 2015)
ql.Settings.instance().evaluationDate = todaysDate
spotDates = [ql.Date(15, 1, 2015), ql.Date(15, 7, 2015), ql.Date(15, 1, 2016)]
spotRates = [0.0, 0.005, 0.007]
dayCount = ql.Thirty360()
calendar = ql.UnitedStates()
interpolation = ql.Linear()
compounding = ql.Compounded
compoundingFrequency = ql.Annual
spotCurve = ql.ZeroCurve(spotDates, spotRates, dayCount, calendar, interpolation,
compounding, compoundingFrequency)
spotCurveHandle = ql.YieldTermStructureHandle(spotCurve)
> TypeError: Wrong number or type of arguments for overloaded function
> 'new_Thirty360'. Possible C/C++ prototypes are:
> QuantLib::Thirty360::Thirty360(QuantLib::Thirty360::Convention,Date …Run Code Online (Sandbox Code Playgroud)