[Numpy-discussion] Boolean array formatting poll

Colin J. Williams cjw at sympatico.ca
Wed Sep 10 04:06:22 CDT 2003


Chris Barker wrote:

>Todd Miller wrote:
>
>  
>
>>>>>>a=numarray.arange(6, type=numarray.Bool); a[::2] = 0; a
>>>>>>            
>>>>>>
>>array([False, True, False, True, False, True], type=Bool)
>>
>>Which format do you prefer?   Please vote for or against changing the
>>format:  +1 (for)  or -1 (against).
>>    
>>
>
>-1
>
>It just makes it harder to read, particularly for a large array
>
>-Chris
>
Perhaps the important thing is to facilitate visual comparison between 
one row and another or between one array and another.  Maybe 'False' and 
'True ' (with a trailing space) could be used as representations of the 
Boolean values.

If a compressed representation is desired then 'F' and 'T' might be used.

This could be specified in a site constant which, for the distribution, 
would default to one of ('0, '1'), ('False', 'True'), ('False', 'True ') 
or ('F', 'T').

My feeling is that, since it can easily be done, it is desirable to 
distinguish between Integer and Boolean values.

Colin W.

>
>
>  
>






More information about the Numpy-discussion mailing list