title: How to check if all values in the columns of a numpy matrix are the same?
body: <p>I want to check if all values in the columns of a numpy array/matrix are the same.
  I tried to use <code>reduce</code> of the <a href="http://docs.scipy.org/doc/numpy/reference/ufuncs.html" rel="noreferrer">ufunc</a> <code>equal</code>, but it doesn't seem to work in all cases:</p>
  
  <pre><code>In [55]: a = np.array([[1,1,0],[1,-1,0],[1,0,0],[1,1,0]])
  
  In [56]: a
  Out[56]: 
  array([[ 1,  1,  0],
         [ 1, -1,  0],
         [ 1,  0,  0],
         [ 1,  1,  0]])
  
  In [57]: np.equal.reduce(a)
  Out[57]: array([ True, False,  True], dtype=bool)
  
  In [58]: a = np.array([[1,1,0],[1,0,0],[1,0,0],[1,1,0]])
  
  In [59]: a
  Out[59]: 
  array([[1, 1, 0],
         [1, 0, 0],
         [1, 0, 0],
         [1, 1, 0]])
  
  In [60]: np.equal.reduce(a)
  Out[60]: array([ True,  True,  True], dtype=bool)
  </code></pre>
  
  <p>Why does the middle column in the second case also evaluate to <code>True</code>, while it should be <code>False</code>?</p>
  
  <p>Thanks for any help!</p>