diff options
author | Travis Oliphant <oliphant@enthought.com> | 2008-04-08 05:02:03 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2008-04-08 05:02:03 +0000 |
commit | 0035f9187945a7d787bcadad38cfb84ca196bc18 (patch) | |
tree | e2992edf487ba9c4f8002d64ec814fd67991ec7c /numpy/lib | |
parent | 7d51a22a398230cf095eee397aea1a8ffd73c10a (diff) | |
download | numpy-0035f9187945a7d787bcadad38cfb84ca196bc18.tar.gz |
Improve comments.
Diffstat (limited to 'numpy/lib')
-rw-r--r-- | numpy/lib/financial.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/numpy/lib/financial.py b/numpy/lib/financial.py index bac276bb7..c5d6d27e7 100644 --- a/numpy/lib/financial.py +++ b/numpy/lib/financial.py @@ -1,5 +1,10 @@ # Some simple financial calculations # patterned after spreadsheet computations. + +# There is some complexity in each function +# so that the functions behave like ufuncs with +# broadcasting and being able to be called with scalars +# or arrays (or other sequences). import numpy as np __all__ = ['fv', 'pmt', 'nper', 'ipmt', 'ppmt', 'pv', 'rate', @@ -125,8 +130,12 @@ So, over 64 months would be required to pay off the loan. The same analysis could be done with several different interest rates and/or payments and/or total amounts to produce an entire table. ->>> nper(*(ogrid[0.06/12:0.071/12:0.005/12, -100:-201:50, 6000:8000:1000])) +>>> nper(*(ogrid[0.06/12:0.071/12:0.01/12, -200:-99:100, 6000:7001:1000])) +array([[[ 32.58497782, 38.57048452], + [ 71.51317802, 86.37179563]], + [[ 33.07413144, 39.26244268], + [ 74.06368256, 90.22989997]]]) """ def ipmt(rate, per, nper, pv, fv=0.0, when='end'): |