[Numpy-discussion] equivalent to isempty command in matlab (newbie question)
robert.kern at gmail.com
Wed Dec 6 11:01:00 CST 2006
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)
> #if s3!=:
> for i3 in arange(len(s3)):
> text(s3[i3], b1[s3[i3]+ini],'***')
> for i2 in arange(len(s2)):
> text(s2[i2], b1[s2[i2]+ini],'**')
> 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 != ).
"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
More information about the Numpy-discussion