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

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


Hi

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

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?

Stephan






More information about the Numpy-discussion mailing list