[Numpy-discussion] Bool array missing sum function.

Todd Miller jmiller at stsci.edu
Wed Aug 18 04:09:30 CDT 2004


I logged this as a bug on Source Forge and I'll look into it.

Todd

On Wed, 2004-08-18 at 07:32, Nadav Horesh wrote:
> 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
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
-- 





More information about the Numpy-discussion mailing list