title: Use a.any() or a.all()
body: <pre><code>x = np.arange(0,2,0.5)
  valeur = 2*x
  
  if valeur &lt;= 0.6:
      print ("this works")
  else:   
      print ("valeur is too high")
  </code></pre>
  
  <p>here is the error I get:</p>
  
  <pre><code>if valeur &lt;= 0.6:
  ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  </code></pre>
  
  <p>I have read several posts about a.any() or a.all() but still can't find a way that really clearly explain how to fix the problem. I see why Python does not like what I wrote but I am not sure how to fix it.</p>