[Numpy-discussion] Bug in numpy all() function
Wed Feb 6 09:11:20 CST 2008
Dan Goodman wrote:
> Hi all,
> I think this is a bug (I'm running Numpy 184.108.40.206):
>>>> from numpy import *
>>>> def f(x): return False
>>>> all(f(x) for x in range(10))
> I guess the all function doesn't know about generators?
That's likely the problem. However, as of Python 2.5, there's a built
in function that will do what you want. However, you would mask that
builtin with the from numpy import *.
Graduate Research Assistant
School of Meteorology
University of Oklahoma
More information about the Numpy-discussion