title: Replace column in a Pandas DataFrame from a lookup DataFrame
body: <p>I have a simple DataFrame with some text values, and I want to replace them with numerical values from a lookup DataFrame:</p>
  <pre><code>df = pd.DataFrame([['Mary', 'good', 7.89], ['Tom', 'poor', 4.41], 
                 ['Anthony', 'good', 7.94], ['Samuel', 'average', 6.21],
                 ['Alex', 'best', 8.87]],
                columns=('Athlete', 'performance', 'time'))
  
  lookup_df = pd.DataFrame([['bad',1],['poor',2],['average',3],
                           ['good',4],['best',5]],
                          columns=('performance_id','vote'))
  </code></pre>
  <p><a href="https://i.stack.imgur.com/79GSW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/79GSW.png" alt="enter image description here" /></a></p>
  <p>I want to replace the <code>performance</code> column with the <code>vote</code> column from the <code>lookup_df</code> DataFrame, so that the result DataFrame look like this:</p>
  <p><a href="https://i.stack.imgur.com/Ospp9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ospp9.png" alt="enter image description here" /></a></p>
  <p>I have tried different Pandas functions, but I always got some kind of error: <code>Can only compare identically-labeled Series objects</code></p>
  <pre><code>df['vote'] = entry_lookup[lookup_df ['performance_id'] == df['performance']]['vote']
  </code></pre>
  <p>or</p>
  <pre><code>df['vote'] = df.lookup(df['performance'], lookup_df ['performance_id'])
  </code></pre>