title: ValueError: How to iterate through a tuple of Boolean True/False statements?
body: <p>I have a numpy ndarray <code>tup1</code> of statements <code>True</code> and <code>False</code></p>
  
  <pre><code>print(tup1)
  
  array([[ True, False, False, False],
         [ True, False, False, False],
         [False, False, False, False],
         [ True,  True, False, False]], dtype=bool)
  </code></pre>
  
  <p>I would like to iterate through this tuple <code>tup1</code> in the following manner:</p>
  
  <pre><code>for i in tup1:
      if i == True:
          pass
      else:
          do something
  </code></pre>
  
  <p>which would do some operation on all 'False' entries. However, this doesn't work: I get the following error:</p>
  
  <pre><code>---------------------------------------------------------------------------
  ValueError 
  Traceback (most recent call last)
  &lt;ipython-input-57-0d2a4ade1205&gt; in &lt;module&gt;()
        1 for i in tup1:
  ----&gt; 2     if i == True:
        3         pass
        4     else:
  
  ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  </code></pre>