Re: [Numpy-discussion] equivalent to isempty command in matlab (newbie question), (Robert Kern)
by Francesc Altet other posts by this author
Dec 7 2006 3:15AM messages near this date
Re: [Numpy-discussion] equivalent to isempty command in matlab (newbie question), (Robert Kern)
|
[Numpy-discussion] pickling arrays: numpy 1.0 can't unpickle numpy 1.0.1
El dj 07 de 12 del 2006 a les 11:36 +0100, en/na Giorgio Luciano va
escriure:
> Does it exist a workaround for that to make numpy understand when an
> array is empty ?
> Giorgio
>
I guess there should be many. One possibility is to use .size:
In [9]:a=numpy.array([])
In [10]:a.size == False
Out[10]:True
In [11]:a=numpy.array([1])
In [12]:a.size == False
Out[12]:False
Cheers,
--
Francesc Altet | Be careful about using the following code --
Carabos Coop. V. | I've only proven that it works,
www.carabos.com | I haven't tested it. -- Donald Knuth
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Thread:
Giorgio Luciano
Francesc Altet
|