diff options
author | Sebastian Berg <sebastian@sipsolutions.net> | 2019-09-14 20:57:50 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-14 20:57:50 -0700 |
commit | 53adf81bc503d749b13160a27e49160c5bbe48d7 (patch) | |
tree | 2d674d8b239f0211525f978f586f68b3c8038c4b /numpy/lib/tests | |
parent | 31ffdecf07d18ed4dbb66b171cb0f998d4b190fa (diff) | |
parent | 594d0c39bd7baf9575411b4a9689ec0bd564c930 (diff) | |
download | numpy-53adf81bc503d749b13160a27e49160c5bbe48d7.tar.gz |
Merge pull request #14508 from Kai-Striega/financial_review
DOC: Add warning to NPV function
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r-- | numpy/lib/tests/test_financial.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_financial.py b/numpy/lib/tests/test_financial.py index 524915041..21088765f 100644 --- a/numpy/lib/tests/test_financial.py +++ b/numpy/lib/tests/test_financial.py @@ -9,6 +9,12 @@ from numpy.testing import ( class TestFinancial(object): + def test_npv_irr_congruence(self): + # IRR is defined as the rate required for the present value of a + # a series of cashflows to be zero i.e. NPV(IRR(x), x) = 0 + cashflows = np.array([-40000, 5000, 8000, 12000, 30000]) + assert_allclose(np.npv(np.irr(cashflows), cashflows), 0, atol=1e-10, rtol=0) + def test_rate(self): assert_almost_equal( np.rate(10, 0, -3500, 10000), |