[Numpy-discussion] Constructing array from generator expression/iterator

Stephan Tolksdorf andorxor at gmx.de
Wed Feb 8 14:47:20 EST 2006


I'm new to Numpy and just stumbled over the following problem in Numpy 

array(x**2 for x in range(10))

does not return what one (me) would suspect, i.e.

array([x**2 for x in range(10)])

Is this expected behavior?


More information about the NumPy-Discussion mailing list