title: How to find if any column in an array has duplicate values
body: <p>Let's say I have a numpy matrix <code>A</code></p>
  
  <pre><code>A = array([[ 0.5,  0.5,  3.7],
             [ 3.8,  2.7,  3.7],
             [ 3.3,  1.0,  0.2]])
  </code></pre>
  
  <p>I would like to know if there is at least two rows <code>i</code> and <code>i'</code> such that <code>A[i, j]=A[i', j]</code> for some column <code>j</code>?</p>
  
  <p>In the example <code>A</code>, <code>i=0</code> and <code>i'=1</code> for <code>j=2</code> and the answer is <code>yes</code>.</p>
  
  <p>How can I do this?</p>
  
  <p>I tried this:</p>
  
  <pre><code>def test(A, n):
      for j in range(n):
          i = 0
          while i &lt; n:
              a = A[i, j]
              for s in range(i+1, n):
                  if A[s, j] == a:
                      return True
              i += 1
      return False
  </code></pre>
  
  <p>Is there a faster/better way?</p>