title: How to fill a pandas dataframe column using a value from another dataframe column
body: <p>Firstly we can import some packages which might be useful</p>
  <pre><code>import pandas as pd
  import datetime
  </code></pre>
  <p>Say I now have a dataframe which has a date, name and age column.</p>
  <pre><code>df1 = pd.DataFrame({'date': ['10-04-2020', '04-07-2019', '12-05-2015' ], 'name': ['john', 'tim', 'sam'], 'age':[20, 22, 27]})
  </code></pre>
  <p>Now say I have another dataframe with some random columns</p>
  <pre><code>df2 = pd.DataFrame({'a': [1,2,3], 'b': [4,5,6]})
  </code></pre>
  <p><strong>Question:</strong></p>
  <p>How can I take the age value in <code>df1</code> filtered on the date (can select this value) and populate a whole new column in <code>df2</code> with this value? Ideally this method should generalise for any number of rows in the dataframe.</p>
  <p><strong>Tried</strong></p>
  <p>The following is what I have tried (on a similar example) but for some reason it doesn't seem to work (it just shows nan values in the majority of column entries except for a few which randomly seem to populate).</p>
  <pre><code>y = datetime.datetime(2015, 5, 12)
  df2['new'] = df1[(df1['date'] == y)].age
  </code></pre>
  <p><em><strong>Expected Output</strong></em></p>
  <p>Since I have filtered above based on sams age (date corresponds to the row with sams name) I would like the new column to be added to df2 with his age as all the entries (in this case 27 repeated 3 times).</p>
  <pre><code>df2 = pd.DataFrame({'a': [1,2,3], 'b': [4,5,6], 'new': [27, 27, 27]})
  </code></pre>