[Numpy-discussion] Numeric/numarray compatibility issue

konrad.hinsen at laposte.net konrad.hinsen at laposte.net
Fri Mar 4 12:20:23 EST 2005


On 04.03.2005, at 19:50, Perry Greenfield wrote:

> Hmmm, I'm a little confused here. If the overflow issue is what you  
> are worried about, then use of Int8 for boolean results would still be  
> a problem

Yes. The question about the difference was just out of curiosity.

>  here. Since Numeric is already likely generating Int32 from logical  
> ufuncs (Int actually), the use of astype(Int) is little different than  
> many of the temporaries that Numeric creates in expressions. I find it  
> hard to believe

It's the same, but it's one more. The only one is some of my  
large-array code, as I have carefully used the three-argument forms of  
the binary operators to avoid intermediate results. I can't do that for  
comparisons between float arrays.

After some consideration, I think the best solution is a special "sum  
integer array" function in my Numeric/numarray adaptor module (the one  
that chooses which module to import). The numarray version can then use  
the type specifier in the reduction.

Konrad.
--
------------------------------------------------------------------------ 
-------
Konrad Hinsen
Laboratoire Leon Brillouin, CEA Saclay,
91191 Gif-sur-Yvette Cedex, France
Tel.: +33-1 69 08 79 25
Fax: +33-1 69 08 82 61
E-Mail: khinsen at cea.fr
------------------------------------------------------------------------ 
-------





More information about the NumPy-Discussion mailing list