[Numpy-discussion] take() over CharArrays

Francesc Alted falted at openlc.org
Fri Dec 12 04:36:01 CST 2003


Hi,

take() doesn't seems to work when applied to numarray CharArrays:

>>> a=strings.array("a"*400, shape=(2,4), itemsize=3)
>>> take(a, (1,2))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/usr/local/lib/python2.3/site-packages/numarray/ufunc.py", line 1766, 
in take
    return array._take((indices,), clipmode=clipmode)
  File "/usr/local/lib/python2.3/site-packages/numarray/generic.py", line 799, 
in _take
    impliedShape, N = _takeShape(self, indices)
  File "/usr/local/lib/python2.3/site-packages/numarray/generic.py", line 133, 
in _takeShape
    if scattered.isbyteswapped() or not scattered.iscontiguous():
AttributeError: 'CharArray' object has no attribute 'isbyteswapped'

and, IMO, that functionality would be nice to have.

Cheers,

-- 
Francesc Alted





More information about the Numpy-discussion mailing list