title: The truth value of an array with more than one element is ambiguous (numerical)
body: <p>I'm stuck with an error and I can't manage to find a solution for it. This is my function:</p>
  
  <pre><code>def rep(N,list,t):
       result=0
       for i in range(N):
           if((list[i]-t)&lt;=t):
               result = result + 1
           else:
               result = result + 0
       return(result/N) 
  </code></pre>
  
  <p>Then I try to plot the function : </p>
  
  <pre><code> plt.plot(x,rep(1000,nEchant,x))
  </code></pre>
  
  <p>And this is what I get : </p>
  
  <pre><code> Traceback (most recent call last):
     File "&lt;pyshell#114&gt;", line 1, in &lt;module&gt;
       plt.plot(x,rep(1000,nEchant,x))
     File "&lt;pyshell#113&gt;", line 4, in rep
       if((list[i]-1)&lt;=t):
   ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  </code></pre>
  
  <p>Thanks!</p>