ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> numpy-discussion
numpy-discussion
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

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved