[Numpy-discussion] Boolean array formatting poll

Chris Barker Chris.Barker at noaa.gov
Wed Sep 10 13:11:46 CDT 2003


Pearu Peterson wrote:

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

That's better. However, I"m still inclined to prefer [1, 0, 0, 1, ....

Someone mentioned making clear the distiction between bool and int
arrays. HOw distict are they? In Python, the bool type is really just a
pretty wrapper around an Int anway. I like it, but if in NumArray, a
bool is really and int in disguise, I'd be just as happy to ahve it be
0, 1, 0, .... If however, a bool really is a totally different beast (or
will be in a future version), then maybe it's worth making the clear
distiction.

-Chris

For what I mean, note in Python 2.3:

>>> a = True
>>> a
True
>>> a * 5
5


Can you do this in NumArray?




-- 
Christopher Barker, Ph.D.
Oceanographer
                                    		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the Numpy-discussion mailing list