Why these don't work??

Emile van Sebille emile at fenx.com
Thu Apr 8 16:27:45 EDT 2010


On 4/8/2010 1:08 PM M. Hamed said...
> On the other hand (other than installing NumPy) is there a built-in
> way to do an array full of zeros or one just like the numpy.zeros()? I
> know I can do it with list comprehension (like [0 for i in
> range(0,20)] but these are too many keystrokes for python :) I was
> wondering if there is a simpler way.

map(lambda _:0, range(20))

Emile




More information about the Python-list mailing list