title: Adding a new column from a match on two other data frames
body: <p>I try to fill a new field <strong>Status</strong> to my <strong>DF</strong> from a match on two other data frames <strong>DF1</strong> and <strong>DF2</strong>.</p>
  <pre><code>df = pd.DataFrame({'CODE': ['REP', 'REP', 'NANQUE','NANQUE', 'AB_DEV'], 'name':['AUDI', 'AUDI', 'VW','MER','FIAT']})
  df1 = pd.DataFrame({'CODE': ['REP', 'NANQUE','AB_DEV'], 'status':['SORT/QUALT', 'ECHEC','OUTBAND']})
  df2 = pd.DataFrame({'name': ['AUDI', 'AUDI','AUDI','VW','VW','MER','FIAT','FIAT','FIAT'], 
                      'status':['SORT', 'SORT','SORT','INCOM','INCOM','INCOM', 'OUTBAND','OUTBAND','OUTBAND'],
                     'CITY':['BOST', 'NY','WC','CH','WC','CH', 'NY','LA','CH']})
  </code></pre>
  <p>Here is my data frame <strong>DF</strong></p>
  <pre><code>CODE    | name
  ---------------  
  REP     | AUDI
  REP     | AUDI
  NANQUE  | VW
  NANQUE  | MER
  AB_DEV  | FIAT
  </code></pre>
  <p>The check is done with the following data frame <strong>DF1</strong></p>
  <pre><code>CODE    | Status
  ------------------
  REP     | SORT/QUAL
  NANQUE  | ECHEC
  AB_DEV  | OUTBAND
  ...
  </code></pre>
  <p>with the following condition :</p>
  <pre class="lang-py prettyprint-override"><code>IF DF['CODE'].isin(DF1['CODE']) and DF1['Status']=='OUTBAND' :
      DF['Status']== 'OUTBAND'
  </code></pre>
  <p>If not the second check is done with the following data frame <strong>DF2</strong></p>
  <pre><code>name   |    Status  |  CITY
  ----------------------------
  AUDI   |   SORT     |  BOST
  AUDI   |   SORT     |   NY
  AUDI   |   SORT     |   WC
  VW     |  INCOM     |   CH
  VW     |  INCOM     |   WC
  MER    |  INCOM     |   CH
  FIAT   |  OUTBAND   |   NY
  FIAT   |  OUTBAND   |   LA
  FIAT   |  OUTBAND   |   CH 
  </code></pre>
  <p>with the following condition :</p>
  <pre class="lang-py prettyprint-override"><code>IF DF['name'] == DF2['name']:
      DF['Status']== DF2['Status']
  </code></pre>
  <p>the final result I'm trying to find</p>
  <pre><code>CODE    |  name  |   Status
  -------------------------------
  REP     |  AUDI  |    SORT
  REP     |  AUDI  |    SORT
  NANQUE  |   VW   |    INCOM
  NANQUE  |   MER  |    INCOM
  AB_DEV  |   FIAT |    OUTBAND
  </code></pre>
  <p>I've tried a np.wehre but it doesn't work. Any idea how to make it work?</p>