title: Update element in dataframe based on value in orther column
body: <p>I want to know which is the best way to update one element in df based on the value of another coulmn in the same dataframe?</p>
  <pre><code>p1[&quot;price Now&quot;] = df_emptyex[&quot;Close&quot;][i]
  </code></pre>
  <p>Above is the code I use to update the colum, but every row got the same value under column &quot;price Now&quot;.</p>
  <p>And the result will be:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">Company</th>
  <th style="text-align: center;">price Now</th>
  <th style="text-align: right;">Value</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">ALFA.ST</td>
  <td style="text-align: center;">192.421814</td>
  <td style="text-align: right;">915.41:</td>
  </tr>
  <tr>
  <td style="text-align: left;">ASSA-B.ST</td>
  <td style="text-align: center;">192.421814</td>
  <td style="text-align: right;">987.81</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want the program to find which row has Company = ASSA-B.ST and update price Now to 200 only on that row like table below:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">Company</th>
  <th style="text-align: center;">price Now</th>
  <th style="text-align: right;">Value</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">ALFA.ST</td>
  <td style="text-align: center;">192.421814</td>
  <td style="text-align: right;">915.41:</td>
  </tr>
  <tr>
  <td style="text-align: left;">ASSA-B.ST</td>
  <td style="text-align: center;">200</td>
  <td style="text-align: right;">987.81</td>
  </tr>
  </tbody>
  </table>
  </div>