title: Excluding duplicates with Python List Comprehension when referencing multiple values of an array
body: <p>The task is to return every row of a 2D data set that has an entry whose value is greater than the column it is a part of.</p>
  
  <p>I'm trying to see if there's a more clever way to do this with list comprehension:</p>
  
  <pre class="lang-py prettyprint-override"><code>data = np.array([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15], [86, 4, 14]])
  sliced = [data[i] for i in range(len(data))
              for j in range(len(data[i]))
                  if data[i,j] &gt; np.mean(data[:,j])]
  </code></pre>
  
  <p>This code returns:</p>
  
  <pre><code>[array([7, 8, 9]), array([10, 11, 12]), array([10, 11, 12]), array([13, 14, 15]), array([13, 14, 15]), array([86,  4, 14]), array([86,  4, 14])]
  </code></pre>
  
  <p>You can see it accomplishes the task, but it leaves duplicates in rows like [10, 11, 12] where both values 11 and 12 are greater than the mean of their columns.</p>
  
  <p>Is there a clever way to exclude additional datapoints from the same row during list comprehension? I could remove duplicates afterward, but in a hypothetical context that might remove valid data that happens to be identical.</p>