[Numpy-discussion] bug in object arrays:

Peter Verveer verveer at embl-heidelberg.de
Sun Jun 6 09:26:05 CDT 2004


Is this a bug?

This should result in an array of numpy arrays, but it does give an  
error:

 >>> a = array([1,2])
 >>> b = array([3,4])
 >>> c = objects.array([a,b])
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/numarray/objects.py", line 732, in array
     return fromlist(sequence, shape)
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/numarray/objects.py", line 755, in fromlist
     return ObjectArray(objects=l, shape=shape)
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/numarray/objects.py", line 506, in __init__
     oshape = _shapeFromNestedSequence(objects)
   File  
"/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ 
python2.3/site-packages/numarray/objects.py", line 289, in  
_shapeFromNestedSequence
     return [len(s)] + _shapeFromNestedSequence(s[0])
TypeError: can only concatenate list (not "tuple") to list





More information about the Numpy-discussion mailing list