[Numpy-discussion] question about nonzero behavior in numarray

Fernando Perez Fernando.Perez at colorado.edu
Thu Apr 1 16:16:16 CST 2004


Joachim Saul wrote:

> How often does it happen that you have an empty array, which you
> need to test for? Certainly not as frequently as in case of a
> list.

Well, just these days I'm working with code where I'm precisely using that 
kind of check, relying on Numeric's behavior.  But I know that with 
potentially nested structures, it's probably best to be explicit and do all 
checks via things like:

if len(a)

and

if a==0

etc.  So I could also be +1 on Perry's wish for turning it into an extension, 
at the expense of my current code breaking.

Cheers,

f.





More information about the Numpy-discussion mailing list