[Numpy-discussion] Non-regular input detection for chararrays

Francesc Alted falted at openlc.org
Mon Dec 15 08:46:01 CST 2003


Hi,

NumArray class seems to detect invalid sequences, but not in CharArray:

>>> array([3, [4, 5.2]])
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.3/site-packages/numarray/numarraycore.py", line 
286, in array
    return fromlist(sequence, type, shape)
  File "/usr/local/lib/python2.3/site-packages/numarray/numarraycore.py", line 
195, in fromlist
    arr.fromlist(seq)
libnumarray.error: setArrayFromSequence: invalid sequence.
>>> strings.array(["aaa", ["bbb", "ccc"]])
CharArray(['aaa', 'bbb'])


-- 
Francesc Alted





More information about the Numpy-discussion mailing list