title: update join pandas - python
body: <p>How to achieve update join on pandas native statement (.apply())?
  I want to update <code>PSMark</code> from Dataframe2 on <code>PhySci</code> in Dataframe1</p>
  
  <p><strong>Dataframe1 (tbl_ex):</strong></p>
  
  <pre><code>|    | Sname   |   Tamil |   English |   Maths |   Science |   Sscience |   PhySci |
  |---:|:--------|--------:|----------:|--------:|----------:|-----------:|---------:|
  |  0 | Abu     |      35 |        65 |      64 |        98 |         36 |        0 |
  |  1 | Eric    |      70 |        54 |      65 |        32 |         58 |       25 |
  |  2 | Mani    |      56 |        25 |      32 |        32 |         78 |       10 |
  |  3 | Ram     |      80 |        24 |      68 |        54 |         76 |        0 |
  |  4 | Tom     |      40 |        26 |      56 |        69 |         42 |       65 |
  |  5 | Eva     |      50 |        18 |      56 |        87 |         56 |        0 |
  </code></pre>
  
  <p><strong>Dataframe2 (tbl_fy):</strong></p>
  
  <pre><code>|    | Sname   |   PSMark |
  |---:|:--------|---------:|
  |  0 | Tom     |       69 |
  |  1 | Ram     |       54 |
  |  2 | Mani    |       32 |
  |  3 | Eva     |       87 |
  |  4 | Sam     |       89 |
  </code></pre>
  
  <p>I achieved this with sqldf module</p>
  
  <pre><code>q="""
      UPDATE tbl_ex
      SET
        PhySci = (SELECT tbl_fy.PSMark
                              FROM tbl_fy
                              WHERE tbl_fy.Sname = tbl_ex.Sname )
      WHERE
      EXISTS (
          SELECT *
          FROM tbl_fy
          WHERE tbl_fy.Sname = tbl_ex.Sname );
      """
  
  sqldf.run(q)
  print(tbl_ex.to_markdown())
  </code></pre>
  
  <p><strong>Final Result from tbl_ex:</strong></p>
  
  <pre><code>|    | Sname   |   Tamil |   English |   Maths |   Science |   Sscience |   PhySci |
  |---:|:--------|--------:|----------:|--------:|----------:|-----------:|---------:|
  |  0 | Abu     |      35 |        65 |      64 |        98 |         36 |        0 |
  |  1 | Eric    |      70 |        54 |      65 |        32 |         58 |       25 |
  |  2 | Mani    |      56 |        25 |      32 |        32 |         78 |       32 |
  |  3 | Ram     |      80 |        24 |      68 |        54 |         76 |       54 |
  |  4 | Tom     |      40 |        26 |      56 |        69 |         42 |       69 |
  |  5 | Eva     |      50 |        18 |      56 |        87 |         56 |       87 |
  
  </code></pre>