[Numpy-discussion] Boolean array formatting poll

Michiel Jan Laurens de Hoon mdehoon at ims.u-tokyo.ac.jp
Wed Sep 10 10:28:12 CDT 2003


-1, for readability.

1's and 0's can be distinguished more easily visually than T's and F's.

Michiel, U Tokyo.

Pearu Peterson wrote:
> 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
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/numpy-discussion
> 
> 

-- 
Michiel de Hoon
Assistant Professor
University of Tokyo, Institute of Medical Science
Human Genome Center
4-6-1 Shirokane-dai, Minato-ku
Tokyo 108-8639
Japan
http://bonsai.ims.u-tokyo.ac.jp/~mdehoon





More information about the Numpy-discussion mailing list