title: 'and' (boolean) vs '&' (bitwise) - Why difference in behavior with lists vs numpy arrays?
body: <p><strong>What explains the difference in behavior of boolean and bitwise operations on lists vs NumPy arrays?</strong> </p>
  
  <p>I'm confused about the appropriate use of <code>&amp;</code> vs <code>and</code> in Python, illustrated in the following examples.</p>
  
  <pre><code>mylist1 = [True,  True,  True, False,  True]
  mylist2 = [False, True, False,  True, False]
  
  &gt;&gt;&gt; len(mylist1) == len(mylist2)
  True
  
  # ---- Example 1 ----
  &gt;&gt;&gt; mylist1 and mylist2
  [False, True, False, True, False]
  # I would have expected [False, True, False, False, False]
  
  # ---- Example 2 ----
  &gt;&gt;&gt; mylist1 &amp; mylist2
  TypeError: unsupported operand type(s) for &amp;: 'list' and 'list'
  # Why not just like example 1?
  
  &gt;&gt;&gt; import numpy as np
  
  # ---- Example 3 ----
  &gt;&gt;&gt; np.array(mylist1) and np.array(mylist2)
  ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
  # Why not just like Example 4?
  
  # ---- Example 4 ----
  &gt;&gt;&gt; np.array(mylist1) &amp; np.array(mylist2)
  array([False,  True, False, False, False], dtype=bool)
  # This is the output I was expecting!
  </code></pre>
  
  <p><a href="https://stackoverflow.com/a/6490106/2098573">This answer</a> and <a href="https://stackoverflow.com/a/10246441/2098573">this answer</a> helped me understand that <a href="http://docs.python.org/2/library/stdtypes.html#boolean-operations-and-or-not" rel="noreferrer"><code>and</code></a> is a boolean operation but <a href="http://docs.python.org/3/reference/expressions.html#binary-bitwise-operations" rel="noreferrer"><code>&amp;</code></a> is a bitwise operation. </p>
  
  <p>I read about <a href="https://wiki.python.org/moin/BitwiseOperators" rel="noreferrer">bitwise operations</a> to better understand the concept, but I am struggling to use that information to make sense of my above 4 examples.</p>
  
  <p>Example 4 led me to my desired output, so that is fine, but I am still confused about when/how/why I should use <code>and</code> vs <code>&amp;</code>. Why do lists and NumPy arrays behave differently with these operators? </p>
  
  <p><strong>Can anyone help me understand the difference between boolean and bitwise operations to explain why they handle lists and NumPy arrays differently?</strong>  </p>