[Numpy-discussion] Boolean array formatting poll

Pearu Peterson pearu at cens.ioc.ee
Wed Sep 10 03:19:03 CDT 2003


Considering the number of `-1`s, how about

>>> a=numarray.arange(6, type=numarray.Bool); a[::2] = 0; a
 array([F, T, F, T, F, T], type=Bool)

which is short and readable.

Pearu





More information about the Numpy-discussion mailing list