title: Value in an array between two numbers in python
body: <p>So making a title that actually explains what i want is harder than i thought, so here goes me explaining it.</p>
  
  <p>I have an array filled with zeros that adds values every time a condition is met, so after 1 time step iteration i get something like this (minus the headers):</p>
  
  <p>current_array = </p>
  
  <pre><code>bubble_size y_coord
  14040       42
  3943        71
  6345        11
  0           0
  0           0
  ....
  </code></pre>
  
  <p>After this time step is complete this current_array gets set as previous_array and is wiped with zeros because there is not a guaranteed number of entries each time. </p>
  
  <p>NOW the real question is i want to be able to check all rows in the first column of the previous_array and see if the current bubble size is within say 5% either side and if so i want to take the current y position away for the value associated with the matching bubble size number in the previous_array's second column. </p>
  
  <p>currently i have something like;</p>
  
  <pre><code>if bubble_size in current_array[:, 0]:
      do_whatever
  </code></pre>
  
  <p>but i don't know how to pull out the associated y_coord without using a loop, which i am fine with doing (there is about 100 rows to the array and atleast 1000 time steps so i want to make it as efficient as possible) but would like to avoid</p>
  
  <p>i have included my thoughts on the for loop (note the current and previous_array are actually current and previous_frame)</p>
  
  <pre><code>for y in range (0, array_size):
      if bubble_size &gt;&gt; previous_frame[y,0] *.95 &amp;&amp;&lt;&lt; previous_frame[y, 0] *1.05:
          distance_travelled = current_y_coord - previous_frame[y,0]
          y = y + 1
  </code></pre>
  
  <p>Any help is greatly appreciated :)</p>