title: Basic NumPy data comparison
body: <p>I have an array of N-dimensional values arranged in a 2D array. Something like:</p>
  
  <pre><code>import numpy as np
  data = np.array([[[1,2],[3,4]],[[5,6],[1,2]]])
  </code></pre>
  
  <p>I also have a single value <code>x</code> that I want to compare against each data point, and I want to get a 2D array of boolean values showing whether my data is equal to <code>x</code>.</p>
  
  <pre><code>x = np.array([1,2])
  </code></pre>
  
  <p>If I do:</p>
  
  <pre><code>data == x
  </code></pre>
  
  <p>I get</p>
  
  <pre><code># array([[[ True,  True],
  #        [False, False]],
  #
  #       [[False, False],
  #        [ True,  True]]], dtype=bool)
  </code></pre>
  
  <p>I could easily combine these to get the result I want. However, I don't want to iterate over each of these slices, especially when <code>data.shape[2]</code> is larger. What I am looking for is a direct way of getting:</p>
  
  <pre><code>array([[ True,  False],
          [False, True]])
  </code></pre>
  
  <p>Any ideas for this seemingly easy task?</p>