title: How to populate a column in one dataframe by comparing it to another dataframe
body: <p>I have a <code>dataframe</code> called <code>res_df</code>:</p>
  
  <pre><code>In [54]: res_df.head()
  Out[54]:       
         Bldg_Sq_Ft        GEOID       CensusPop  HU_Pop  Pop_By_Area
  0     753.026123  240010013002022       11.0     7.0          NaN
  7      95.890495  240430003022003       17.0     8.0          NaN
  8    1940.862793  240430003022021       86.0    33.0          NaN
  24   2254.519775  245102801012021       27.0    13.0          NaN
  25  11685.613281  245101503002000      152.0    74.0          NaN
  </code></pre>
  
  <p>I have a second dataframe made from the summarized information in <code>res_df</code>. It's grouped by the <code>GEOID</code> column and then summarized using aggregations to get the <code>sum</code> of the <code>Bldg_Sq_Ft</code> and the <code>mean</code> of the <code>CensusPop</code> columns for each unique <code>GEOID</code>. Let's call it <code>geoid_sum</code>:</p>
  
  <pre><code>In [55]:geoid_sum = geoid_sum.groupby('GEOID').agg({'GEOID': 'count', 'Bldg_Sq_Ft': 'sum', 'CensusPop': 'mean'})
  In [56]: geoid_sum.head()
  Out[56]: 
                        GEOID    Bldg_Sq_Ft  CensusPop
      GEOID                                          
      100010431001011      1   1154.915527        0.0
      100030144041044      1   5443.207520       26.0
      100050519001066      1   1164.390503        4.0
      240010001001001     15  30923.517090       41.0
      240010001001007      3   6651.656677        0.0
  </code></pre>
  
  <p>My goal is to find the <code>GEOID</code>s in <code>res_df</code> that match the <code>GEOID</code>'s in <code>geoid_sum</code>. I want to populate the value in <code>Pop_By_Area</code> for that row using an equation:</p>
  
  <p><code>Pop_By_Area = (geoid_sum['CensusPop'] * ref_df['Bldg_Sq_Ft'])/geoid_sum['Bldg_Sq_Ft']</code></p>
  
  <p>I've created a simple function that takes those parameters, but I am unsure how to iterate through the dataframes and apply the function.</p>
  
  <pre><code>def popByArea(census_pop_mean, bldg_sqft, bldg_sqft_sum):
      x = float()
      x = (census_pop_mean * bldg_sqft)/bldg_sqft_sum
      return x
  </code></pre>
  
  <p>I've tried creating a series based on the <code>GEOID</code> matches: <code>s = res_df.GEOID.isin(geoid_sum.GEOID.values)</code> but that didn't seem to work (produced all false boolean values). How can I find the matches and apply my function to populate the <code>Pop_By_Area</code> column?</p>