title: Finding matches in Panda DataFrame by matching a Panda DataFrame
body: <p>Trying to return the rows of an array where a column matches the values of another array.</p>
  
  <p>I start with <code>elm</code> value and call the <code>nearby</code> function to find other elms near <code>elm</code> based on searching the <code>df</code> table. Function returns result like this (all int):</p>
  
  <pre><code>    C1    C2    C3    C4
  0  100    20    11     1
  </code></pre>
  
  <p>So I need to extract the information from <code>elm_data_table</code> that satisfies two conditions:</p>
  
  <p>1) The value in <code>LC-col</code> column matches <code>LC</code> value</p>
  
  <p>2) The value in <code>ELM</code> column has to match each of the 4 values from <code>other_elm</code></p>
  
  <p>I'm expecting 4 rows of data from <code>elm_data_table</code> as I'm trying to find data for 4 values</p>
  
  <p>Any tips?</p>
  
  <pre><code>import panda as pd
  
  #df and elm_data_table are Panda dataframes
  
  def nearby(elm, df):
      return df[df['ELM'] == elm].iloc[:,5:9]
  
  elm = 1000
  LC = 200
  
  other_elm = nearby(elm, df)
  
  other_elm_info = elm_data_table[(elm_data_table['LC-col'] == LC) &amp; (elm_data_table['ELM'] == other_elm )]
  </code></pre>