@@ -245,7 +245,7 @@ def pmt(rate, nper, pv, fv=0, when='end'):
245
245
years at an annual interest rate of 7.5%?
246
246
247
247
>>> npf.pmt(0.075/12, 12*15, 200000)
248
- -1854.0247200054619
248
+ np.float64( -1854.0247200054619)
249
249
250
250
In order to pay-off (i.e., have a future-value of 0) the $200,000 obtained
251
251
today, a monthly payment of $1,854.02 would be required. Note that this
@@ -424,7 +424,7 @@ def ipmt(rate, per, nper, pv, fv=0, when='end'):
424
424
425
425
>>> interestpd = np.sum(ipmt)
426
426
>>> np.round(interestpd, 2)
427
- -112.98
427
+ np.float64( -112.98)
428
428
429
429
"""
430
430
when = _convert_when (when )
@@ -562,7 +562,7 @@ def pv(rate, nper, pmt, fv=0, when='end'):
562
562
interest rate is 5% (annually) compounded monthly.
563
563
564
564
>>> npf.pv(0.05/12, 10*12, -100, 15692.93)
565
- -100.00067131625819
565
+ np.float64( -100.00067131625819)
566
566
567
567
By convention, the negative sign represents cash flow out
568
568
(i.e., money not available today). Thus, to end up with
@@ -913,7 +913,7 @@ def npv(rate, values):
913
913
914
914
>>> rate, cashflows = 0.08, [-40_000, 5_000, 8_000, 12_000, 30_000]
915
915
>>> np.round(npf.npv(rate, cashflows), 5)
916
- 3065.22267
916
+ np.float64( 3065.22267)
917
917
918
918
It may be preferable to split the projected cashflow into an initial
919
919
investment and expected future cashflows. In this case, the value of
@@ -923,7 +923,7 @@ def npv(rate, values):
923
923
>>> initial_cashflow = cashflows[0]
924
924
>>> cashflows[0] = 0
925
925
>>> np.round(npf.npv(rate, cashflows) + initial_cashflow, 5)
926
- 3065.22267
926
+ np.float64( 3065.22267)
927
927
928
928
The NPV calculation may be applied to several ``rates`` and ``cashflows``
929
929
simulatneously. This produces an array of shape ``(len(rates), len(cashflows))``.
0 commit comments