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

numpy-svn@scip... numpy-svn@scip...
Tue Apr 10 21:05:13 CDT 2007


Author: eric
Date: 2007-04-10 21:05:06 -0500 (Tue, 10 Apr 2007)
New Revision: 3699

Modified:
   trunk/numpy/lib/function_base.py
Log:
fixed a typecode Float->float issue in average.

This is not pretty code it seems overly complicated, and it has an "eval"
statement in it where it builds a string and evaluates it.  I can't imagine
this is the best approach to this -- but I also am not going to spend the
time to examine it right now.

Modified: trunk/numpy/lib/function_base.py
===================================================================
--- trunk/numpy/lib/function_base.py	2007-04-10 22:16:10 UTC (rev 3698)
+++ trunk/numpy/lib/function_base.py	2007-04-11 02:05:06 UTC (rev 3699)
@@ -306,7 +306,7 @@
                 ni = ash[axis]
                 r = [newaxis]*ni
                 r[axis] = slice(None, None, 1)
-                w1 = eval("w["+repr(tuple(r))+"]*ones(ash, Float)")
+                w1 = eval("w["+repr(tuple(r))+"]*ones(ash, float)")
                 n = add.reduce(a*w1, axis)
                 d = add.reduce(w1, axis)
             else:



More information about the Numpy-svn mailing list