title: Any way to optimize the running time? Trying to add data to a new column from different dataframe
body: <p>I've got 2 dataframe: Nodes and Edges.
  The edges DF only contains the From ID and to ID, my goal is to add two more columns (From Age, To Age) in order to do some statistics. the age data sits in the Nodes DF.
  <strong>There are about 1.2M of nodes and 14M of edges in the dataframes</strong></p>
  <p>right now this is how I'm trying to make it happen:</p>
  <pre><code>edges['From Age'] = np.nan
  for i in range(len(edges)):
     edges.loc[i+1, 'From Age'] = int((nodes.loc[nodes['ID'] == (edges.iloc[i])['From']])['Age'])
  </code></pre>
  <p>This is taking ages (went hours without finishing) and I can't find or think of more efficient way to work this out.
  Please give me some guidance.</p>
  <p>**An example slice of my data (after I filtered irrelavant rows like ID=2:</p>
  <pre><code>ID,Gender,Region,Age
  1,1.0,&quot;zilinsky kraj, zilina&quot;,26.0
  3,1.0,&quot;bratislavsky kraj, bratislava - karlova ves&quot;,29.0
  4,0.0,&quot;banskobystricky kraj, brezno&quot;,26.0
  5,1.0,&quot;zilinsky kraj, zilina&quot;,26.0
  6,0.0,&quot;zilinsky kraj, zilina&quot;,38.0
  </code></pre>
  <p>And few edges:</p>
  <pre><code>From,To
  1,6
  1,3
  1,4
  1,5
  </code></pre>