|
From: jian Xu <jia...@gm...> - 2021-04-09 16:59:43
|
I see. Thanks! On Fri, Apr 9, 2021 at 4:31 AM Luigi Ballabio <lui...@gm...> wrote: > > As David said — or you can avoid the map by selecting the first coupon before conversion: > > c = ql.as_floating_rate_coupon(bnd.cashflows()[0]) > myindex = c.index() > > > On Fri, Apr 9, 2021 at 10:25 AM David Duarte <nh...@gm...> wrote: >> >> Hi, >> >> I'm not sure the index is exposed for the bond object, but you can extract it from the cashflows. >> Maybe not the easiest way to go about it, but hopefully you'll get the idea: >> >> bnd = ql.FloatingRateBond(...) >> c = [*map(ql.as_floating_rate_coupon, bnd.cashflows())][0] >> myindex = c.index() >> >> Regards, >> David >> >> On Fri, 9 Apr 2021 at 03:03, jian Xu <jia...@gm...> wrote: >>> >>> Hi, >>> >>> An index is passed in duration the construction of a FloatingRateBond, >>> But after that, given the FloatingRateBond object, how do I get the >>> index back (in Python)? Thanks. >>> >>> Jian >>> >>> >>> _______________________________________________ >>> QuantLib-users mailing list >>> Qua...@li... >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >> >> _______________________________________________ >> QuantLib-users mailing list >> Qua...@li... >> https://lists.sourceforge.net/lists/listinfo/quantlib-users |