title: Fetch data from another dataframe
body: <p>I had asked a question earlier but it was closed as the initial question was considered as duplicate.</p>
  
  <p>But I am trying to something different from that thread as well as duplicate thread. </p>
  
  <p><a href="https://stackoverflow.com/questions/60294121/string-replacement-from-another-dataframe">String Replacement From Another DataFrame.</a></p>
  
  <p>So please don't close this thread.
  Thanks.</p>
  
  <p>I need to replace my column depending upon data from another dataframe.
  Have to search for respective "name" from the other dataframe and include the "change_name" in the df1</p>
  
  <p>DataFrame 1:</p>
  
  <pre><code>ID  name
  1   cat
  2   jack
  3   snake
  4   monkey
  </code></pre>
  
  <p>DataFrame 2:</p>
  
  <pre><code>name    change_name
  cat     meow
  jack    oooo 
  snake   ssss
  monkey 
  note    money
  pencil pen
  </code></pre>
  
  <p>Expected Output:</p>
  
  <pre><code>ID  name
  1   cat      meow
  2   jack     oooo
  3   snake    ssss
  4   monkey   nan
  5   note    money
  6   pencil pen
  </code></pre>
  
  <p>I had to do like below:</p>
  
  <pre><code>def map_name(name):
      elif name == 'cat':
          return 'meow'
      elif name == 'jack':
          return 'oooo'
      elif name == 'snake':
          return 'ssss'
      elif name == 'monkey ':
          return None
      else
          return name
  </code></pre>
  
  <p><code>df1['name'] = df1['name'].apply(map_name)</code></p>
  
  <p>As the list is small, I have hardcoded here but the list might grow. Can someone tell how to do the same functionality using dataframes? Thanks.</p>