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)
by Robert Kern other posts by this author
Dec 6 2006 9:01AM messages near this date
Re: [Numpy-discussion] equivalent to isempty command in matlab (newbie question) | [Numpy-discussion] compile scipy by using intel compiler
Giorgio Luciano wrote:
>  Today  I've also posted a question to scipy groups because I've thought 
>  I've found a solution but
>  
>  this work good
>  
>  bar(N, b1[:,0], width, color='r', yerr=binterv)
>   ############
>   s3=find(sig1[:,arange(ini,c)]<=0.001)
>   b1=b.flatten()
>   #if s3!=[]:
>   for i3 in arange(len(s3)):
>    text(s3[i3], b1[s3[i3]+ini],'***')
>   s2=find(logical_and(sig1[:,arange(ini,c)]>0.001,sig1[:,arange(ini,c)]<=0.01))
>   for i2 in arange(len(s2)):
>    text(s2[i2], b1[s2[i2]+ini],'**')
>   s1=find(logical_and(sig1[:,arange(ini,c)]>0.01,sig1[:,arange(ini,c)]<=0.05))
>   for i1 in arange(len(s1)):
>    text(s1[i1], b1[s1[i1]+ini],'*')
>   title('Plot of the coefficients of the model')
>  
>  and when i uncomment the ifs3!=[] part it does not...
>  so in this case I've solve the problem.. but is there an equivalent for 
>  isempty matlab command in numpy ?

Use (len(s3) != 0) instead of (s3 != []).

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].org
http://projects.scipy.org/mailman/listinfo/numpy-discussion
Thread:
Giorgio Luciano
Filip Wasilewski
Robert Kern
Filip Wasilewski
Robert Kern

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