On 10/18/06, Alan G Isaac <[EMAIL PROTECTED]> wrote:
On Wed, 18 Oct 2006, Keith Goodman apparently wrote:

<snip>

Here's a simpler (?) example:
>>> x=numpy.random.rand(300,1)>0
>>> x.sum()
300
>>> sum(x)
array([44], dtype=int8)
>>> x=numpy.random.rand(300)>0
>>> sum(x)
300

Alan Isaac

Hmmm, I think sum(x) and x.sum() should behave the same. Note that

In [12]:sum(x, dtype=int)
Out[12]:300

I think sum should stick to the modular arithmetic unless specified otherwise. But in any case sum(x) and x.sum() should do the same thing.

Chuck


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to