Author: Justin Peel <[email protected]>
Branch:
Changeset: r45486:61077eb4052f
Date: 2011-07-11 09:26 -0600
http://bitbucket.org/pypy/pypy/changeset/61077eb4052f/
Log: Changed numpy array's mean method to use the sum method
diff --git a/pypy/module/micronumpy/interp_numarray.py
b/pypy/module/micronumpy/interp_numarray.py
--- a/pypy/module/micronumpy/interp_numarray.py
+++ b/pypy/module/micronumpy/interp_numarray.py
@@ -260,13 +260,7 @@
return self.get_concrete().descr_setitem(space, item, value)
def descr_mean(self, space):
- s = 0
- concrete = self.get_concrete()
- size = concrete.find_size()
- for i in xrange(size):
- s += concrete.getitem(i)
- return space.wrap(s / size)
-
+ return
space.wrap(space.float_w(self.descr_sum(space))/self.find_size())
class FloatWrapper(BaseArray):
"""
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit