[Numpy-discussion] Numarray 0.5
Peter Verveer
verveer at embl-heidelberg.de
Tue May 6 05:25:07 EDT 2003
Hi All,
I found the following problems after testing my software with numarray 0.5:
1) Following works fine if both a and b are arrays:
>>> a = array([2])
>>> b = array([1, 2])
>>> print a + b
[3 4]
However, if b is an python sequence:
>>> a = array([2])
>>> b = [1, 2]
>>> print a + b
[3]
Apparently broadcasting does not work with python sequeces anymore. This used
to work fine in version 0.4. Is this a bug?
2) It is not possible to compare an array type object to the 'Any' object:
>>> Float64 == Any
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.2/site-packages/numarray/numerictypes.py", line
112, in __cmp__
return (genericTypeRank.index(self.name) -
ValueError: list.index(x): x not in list
I am not sure if this is a bug, or intended behaviour, but the possibilty to
compare an array type object to 'Any' would be very useful for me.
3) The NA_typeNoToTypeObject() function fails if it is called before any
arrays are created. It looks to me as if the pNumType array in
libnumarraymodule.c is not initialized until an array is created. I don't
know if any other functions are affected in the same way. Could this be
fixed?
Cheers, Peter
--
Dr. Peter J. Verveer
Cell Biology and Cell Biophysics Programme
EMBL
Meyerhofstrasse 1
D-69117 Heidelberg
Germany
Tel. : +49 6221 387245
Fax : +49 6221 387242
Email: Peter.Verveer at embl-heidelberg.de
More information about the NumPy-Discussion
mailing list