[Numpy-discussion] numpy all unexpected result (generator)
Tue Jan 31 09:18:26 CST 2012
On Tue, Jan 31, 2012 at 15:13, Benjamin Root <email@example.com> wrote:
> Is np.all() using np.array() or np.asanyarray()? If the latter, I would
> expect it to return a numpy array from a generator.
Why would you expect that?
|37> np.asanyarray(i>5 for i in range(10))
array(<generator object <genexpr> at 0xdc24a08>, dtype=object)
"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
-- Umberto Eco
More information about the NumPy-Discussion