logo       

Bool array missing sum function.: msg#00050

python.numeric.general

Subject: Bool array missing sum function.

Why Bool arrays are missing the sum method?

>>> b = array((1,0,1), type=Bool)
>>> b
array([1, 0, 1], type=Bool)
>>> b.sum()

Traceback (most recent call last):
File "<pyshell#129>", line 1, in -toplevel-
b.sum()
File "/usr/local/lib/python2.4/site-packages/numarray/numarraycore.py", line
1125, in sum
return ufunc.add.reduce(ufunc.add.areduce(self, type=type).flat, type=type)
File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line 1165,
in _cum_cache_miss
mode, win1, wout, cfunc, ufargs = \
File "/usr/local/lib/python2.4/site-packages/numarray/ufunc.py", line 1225,
in _cum_setup
otype, cfunc = ufdict[(optype,)]
KeyError: Bool

Nadav.


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise