[Numpy-svn] r4987 - trunk/numpy/lib

numpy-svn@scip... numpy-svn@scip...
Tue Apr 8 00:02:04 CDT 2008


Author: oliphant
Date: 2008-04-08 00:02:03 -0500 (Tue, 08 Apr 2008)
New Revision: 4987

Modified:
   trunk/numpy/lib/financial.py
Log:
Improve comments.

Modified: trunk/numpy/lib/financial.py
===================================================================
--- trunk/numpy/lib/financial.py	2008-04-08 04:56:12 UTC (rev 4986)
+++ trunk/numpy/lib/financial.py	2008-04-08 05:02:03 UTC (rev 4987)
@@ -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 @@
 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'):



More information about the Numpy-svn mailing list