@@ -115,7 +115,7 @@ def fv(rate, nper, pmt, pv, when='end'):
115
115
5% (annually) compounded monthly?
116
116
117
117
>>> npf.fv(0.05/12, 10*12, -100, -100)
118
- 15692.928894335748
118
+ 15692.92889433575
119
119
120
120
By convention, the negative sign represents cash flow out (i.e. money not
121
121
available today). Thus, saving $100 a month at 5% annual interest leads
@@ -126,7 +126,7 @@ def fv(rate, nper, pmt, pv, when='end'):
126
126
127
127
>>> a = np.array((0.05, 0.06, 0.07))/12
128
128
>>> npf.fv(a, 10*12, -100, -100)
129
- array([ 15692.92889434, 16569.87435405, 17509.44688102]) # may vary
129
+ array([15692.92889434, 16569.87435405, 17509.44688102])
130
130
131
131
"""
132
132
when = _convert_when (when )
@@ -296,9 +296,9 @@ def nper(rate, pmt, pv, fv=0, when='end'):
296
296
... 8000 : 9001 : 1000]))
297
297
array([[[ 64.07334877, 74.06368256],
298
298
[108.07548412, 127.99022654]],
299
+ <BLANKLINE>
299
300
[[ 66.12443902, 76.87897353],
300
301
[114.70165583, 137.90124779]]])
301
-
302
302
"""
303
303
when = _convert_when (when )
304
304
rate , pmt , pv , fv , when = np .broadcast_arrays (rate , pmt , pv , fv , when )
@@ -561,7 +561,7 @@ def pv(rate, nper, pmt, fv=0, when='end'):
561
561
562
562
>>> a = np.array((0.05, 0.04, 0.03))/12
563
563
>>> npf.pv(a, 10*12, -100, 15692.93)
564
- array([ -100.00067132, -649.26771385, -1273.78633713]) # may vary
564
+ array([ -100.00067132, -649.26771385, -1273.78633713])
565
565
566
566
So, to end up with the same $15692.93 under the same $100 per month
567
567
"savings plan," for annual interest rates of 4% and 3%, one would
@@ -878,7 +878,7 @@ def npv(rate, values):
878
878
net present value:
879
879
880
880
>>> rate, cashflows = 0.08, [-40_000, 5_000, 8_000, 12_000, 30_000]
881
- >>> npf.npv(rate, cashflows).round( 5)
881
+ >>> round( npf.npv(rate, cashflows), 5)
882
882
3065.22267
883
883
884
884
It may be preferable to split the projected cashflow into an initial
@@ -967,9 +967,9 @@ def mirr(values, finance_rate, reinvest_rate, *, raise_exceptions=False):
967
967
and the `raise_exceptions` parameter is set to True.
968
968
969
969
>>> npf.mirr([100, 50, 60, 70], 0.10, 0.12, raise_exceptions=True)
970
- NoRealSolutionError: No real solution exists for MIRR since all
971
- cashflows are of the same sign .
972
-
970
+ Traceback (most recent call last):
971
+ .. .
972
+ numpy_financial._financial.NoRealSolutionError: No real solution exists for MIRR since all cashflows are of the same sign.
973
973
"""
974
974
values = np .asarray (values )
975
975
n = values .size
0 commit comments