[Numpy-discussion] coercion of arrays

verveer at embl-heidelberg.de verveer at embl-heidelberg.de
Mon Dec 2 15:28:03 CST 2002


I was looking at the coercion of arrays in the new numarray. The following is 
not intuitive to me:

>>> a = array(1, Int8)
>>> b = array(1, UInt16)
>>> c = a + b
>>> c.type()

Should the result not be a signed integer type?

Also the following result is strange to me:

>>> a = array(1, Float64)
>>> b = array(1, Complex32)
>>> c = a + b
>>> c.type()

Complex64 would seem to be the more apropiate type here for the result.

Could somebody comment if these are bugs or not?

Cheers, Peter

Dr. Peter J. Verveer
Cell Biology and Cell Biophysics Programme
European Molecular Biology Laboratory
Meyerhofstrasse 1
D-69117 Heidelberg
Tel. : +49 6221 387245
Fax  : +49 6221 387242
Email: Peter.Verveer at embl-heidelberg.de


More information about the Numpy-discussion mailing list