title: compare tuple with tuples in numpy array
body: <p>I have an array (dtype=object) with the first column containing tuples of arrays and the second column containing scalars. I want all scalars from the second column where the tuples in the first column equal a certain tuple.</p>
  
  <p>Say</p>
  
  <pre><code>&gt;&gt;&gt; X
  array([[(array([ 21.]), array([ 13.])), 0.29452519286647716],
     [(array([ 25.]), array([ 9.])), 0.9106600600510809],
     [(array([ 25.]), array([ 13.])), 0.8137344043493814],
     [(array([ 25.]), array([ 14.])), 0.8143093864975313],
     [(array([ 25.]), array([ 15.])), 0.6004337591112664],
     [(array([ 25.]), array([ 16.])), 0.6239450452872853],
     [(array([ 21.]), array([ 13.])), 0.32082105959687424]], dtype=object)
  </code></pre>
  
  <p>and I want all rows where the 1st column equals X[0,0].</p>
  
  <pre><code>ar = X[0,0]
  &gt;&gt;&gt; ar
  (array([ 21.]), array([ 13.]))
  </code></pre>
  
  <p>I thaugh checking <code>X[:,0]==ar</code> should find me those rows. I would had then retrieved my final result by <code>X[X[:,0]==ar,1]</code>. </p>
  
  <p>What seems to happen, however, is that <code>ar</code> gets to be interpreted as a 2dimensional array and each single element in <code>ar</code> is compared to the tuples in <code>X[:,0]</code>. This yields a, in this case, 2x7 array all entries equal to <code>False</code>. In contrast, the comparison <code>X[0,0]==ar</code> works just as I would want it giving a value of <code>True</code>. </p>
  
  <p>Why is that happening and how can I fix it to obtain the desired result?  </p>