[Numpy-discussion] How are Booleans to be handled?

Colin J. Williams cjw at sympatico.ca
Mon Aug 18 12:45:09 EDT 2003


This statement:
            z= _n.array([True, False, True, True], type= _nt.BooleanType)
gives an exception:
Traceback (most recent call last):
 File "<interactive input>", line 1, in ?
 File 
"C:\PROGRA~1\Python23\lib\site-packages\numarray\numarraycore.py", line 
284, in array
   type = getTypeObject(sequence, type, typecode)
 File 
"C:\PROGRA~1\Python23\lib\site-packages\numarray\numarraycore.py", line 
217, in getTypeObject
   return getType(type)
 File 
"C:\PROGRA~1\Python23\lib\site-packages\numarray\numarraycore.py", line 
324, in getType
   raise TypeError("Not a numeric type")
TypeError: Not a numeric type

If we leave out the type parameter, the array is created with 32 bit words.

Colin W.








More information about the NumPy-Discussion mailing list