-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Aug 27, 2006, at 4:19 PM, numpy-discussion- [EMAIL PROTECTED] wrote:
>> >> It seems like numpy.sum breaks generator expressions: >> >> In [1]: sum(i*i for i in range(10)) >> Out[1]: 285 >> >> In [2]: from numpy import sum >> >> In [3]: sum(i*i for i in range(10)) >> Out[3]: <generator object at 0x10eca58> >> >> Is this intentional? If so, how do I get the behaviour that I am >> after? >> > > > In [3]: sum([i*i for i in range(10)]) > Out[3]: 285 Well, thats a list comprehension, not a generator expression. I was after the latter because it is more efficient. Thanks, C. - -- Christopher Fonnesbeck + Atlanta, GA + fonnesbeck at mac.com + Contact me on AOL IM using email address -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (Darwin) iD8DBQFE8hgdkeka2iCbE4wRAq8lAJ9dKPYQ35IE3qacf9K1KsBL59mdRACePn5S x0wHWs/PrVcJHCqf9tbQwRk= =0wFp -----END PGP SIGNATURE----- ------------------------------------------------------------------------- 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 [email protected] https://lists.sourceforge.net/lists/listinfo/numpy-discussion
