[Numpy-discussion] equivalent to isempty command in matlab (newbie question), (Robert Kern)

Giorgio Luciano giorgio.luciano at chimica.unige.it
Thu Dec 7 04:36:03 CST 2006



> Today's Topics:
>
>    1. Re: equivalent to isempty command in matlab	(newbie question)
>       (Robert Kern)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 06 Dec 2006 11:20:19 -0600
> From: Robert Kern <robert.kern at gmail.com>
> Subject: Re: [Numpy-discussion] equivalent to isempty command in
> 	matlab	(newbie question)
> To: Discussion of Numerical Python <numpy-discussion at scipy.org>
> Message-ID: <4576FBD3.3090601 at gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> Filip Wasilewski wrote:
>
>   
>> Just like for other Python objects:
>>
>> if ifs3:
>>    print "not empty"
>>     
>
> No, that doesn't work. numpy arrays do not have a truth value. They raise an
> error when you try to use them in such a context.
>
>   
Does it exist a workaround for that to make numpy understand when an 
array is empty ?
Giorgio




More information about the Numpy-discussion mailing list