On Sat, May 24, 2008 at 9:21 PM, Alan G Isaac <[EMAIL PROTECTED]> wrote:

> On Sat, 24 May 2008, Keith Goodman apparently wrote:
> >>> x = np.array([True, True], dtype=bool)
> >>> x.sum()
> >    2
>
>
>
> If you want bools, change the accumulator dtype::
>
>    >>> x.sum(dtype=bool)


Shouldn't that be the other way round? If you want integers, do
x.sum(dtype=int). Ints don't sum in float64 by default.

Chuck
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to