title: Python/pandas: Find matching values from two dataframes and return third value
body: <p>I have two different dataframes (df1, df2) with completely different shapes: df1: (64, 6); df2: (564, 9).
  df1 contains a column (df1.objectdesc) which has values (strings) that can also be found in a column in df2 (df2.objdescription). As the two dataframes have different shapes I have to work with <code>.isin()</code> to get the matching values. I then would like to get a third value from a different column in df2 (df2.idname) from exactly those rows which match and add them to df1 - this is where I struggle.</p>
  
  <p>example datasets:</p>
  
  <p>df1</p>
  
  <pre><code>      Content    objectdesc    TS_id
  0     sdrgs      1_OG.Raum45   55
  1     sdfg       2_OG.Raum23   34
  2     psdfg      GG.Raum12     78
  3     sdfg       1_OG.Raum98   67
  </code></pre>
  
  <p>df2:</p>
  
  <pre><code>      Numb_val    object_count     objdescription    min   idname
  0     463         9876             1_OG_Raum76       1     wq19
  1     251         8324             2_OG.Raum34       9     zt45
  2     456         1257             1_OG.Raum45       4     bh34
  3     356         1357             2_OG.Raum23       3     if32
  4     246         3452             GG.Raum12         5     lu76
  5     345         8553             1_OG.Raum98       8     pr61
  </code></pre>
  
  <p>expected output:</p>
  
  <pre><code>      Content    objectdesc    TS_id    idname
  0     sdrgs      1_OG.Raum45   55       bh34
  1     sdfg       2_OG.Raum23   34       if32
  2     psdfg      GG.Raum12     78       lu76
  3     sdfg       1_OG.Raum98   67       pr61
  </code></pre>
  
  <p>This is my code so far:</p>
  
  <pre><code>def get_id(x, y):
      for values in x,y:
          if x['objectdesc'].isin(y['objdescription']).any() == True:
              return y['idname']
  
  df1['idname'] = get_id(df1, df2) 
  </code></pre>
  
  <p>This unfortunately only provides the values of <code>df2['idname']</code> starting from index 0, instead of really giving me the values from the rows which match.</p>
  
  <p>Any help is appreciated. Thank you!</p>