# yield-to-maturity

Published articles for yield-to-maturity.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Bond Pricing With Python: Present Value, Yield to Maturity, and Duration

DevFeed: [Bond Pricing With Python: Present Value, Yield to Maturity, and Duration](<https://devfeed.tech/articles/bond-pricing-with-python-present-value-yield-to-maturity-and-duration-102738.md>)

Original publisher: [Read original article](<https://hackernoon.com/bond-pricing-with-python-present-value-yield-to-maturity-and-duration?source=rss>)

Author: Tobechi

Published: 2026-10-27T17:20:59Z

Content type: article

Language: en

Sources: [HackerNoon](<https://devfeed.tech/sources/hackernoon.md>)

Topics: [Finance](<https://devfeed.tech/topics/finance.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [bond-convexity](<https://devfeed.tech/tags/bond-convexity.md>), [bond-pricing](<https://devfeed.tech/tags/bond-pricing.md>), [bond-valuation](<https://devfeed.tech/tags/bond-valuation.md>), [bonds](<https://devfeed.tech/tags/bonds.md>), [calculus](<https://devfeed.tech/tags/calculus.md>), [code](<https://devfeed.tech/tags/code.md>), [discount](<https://devfeed.tech/tags/discount.md>), [interest-rate-risk](<https://devfeed.tech/tags/interest-rate-risk.md>), [maturity](<https://devfeed.tech/tags/maturity.md>), [money](<https://devfeed.tech/tags/money.md>), [pricing](<https://devfeed.tech/tags/pricing.md>), [python](<https://devfeed.tech/tags/python.md>), [python-bond-pricing](<https://devfeed.tech/tags/python-bond-pricing.md>), [quantitative-finance](<https://devfeed.tech/tags/quantitative-finance.md>), [time](<https://devfeed.tech/tags/time.md>), [time-value-of-money](<https://devfeed.tech/tags/time-value-of-money.md>), [value](<https://devfeed.tech/tags/value.md>), [yield](<https://devfeed.tech/tags/yield.md>), [yield-to-maturity](<https://devfeed.tech/tags/yield-to-maturity.md>)

### AI overview

Bond prices equal the present value of their future coupon and principal payments, discounted at the market rate. The example prices a $1,000, three-year bond with a 5% coupon at $973.27 using a 6% annual discount rate, and at $972.91 with semiannual payments. Python functions implement present value and bond pricing for annual or semiannual periods; bisection estimates yield to maturity from price. A finite-difference calculation estimates modified duration, which approximates percentage price sensitivity to a one percentage point yield move. The example's duration of about 2.70 predicts a roughly 2.7% price move, while convexity explains why actual changes curve away from that linear estimate, especially for larger yield shifts. The article notes that callable bonds, inflation-linked bonds, default risk, and yield curves require further treatment.

### Source excerpt

How bond pricing works: time value of money, discounting, yield to maturity, and duration, explained