title: How to enter the value of one index and column into a new cell with +1 in the iteration?
body: <p>I have the following DataFrame named df1:</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">col1</th>
  <th style="text-align: center;">col2</th>
  <th style="text-align: right;">col3</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">5</td>
  <td style="text-align: center;">3</td>
  <td style="text-align: right;">50</td>
  </tr>
  <tr>
  <td style="text-align: left;">10</td>
  <td style="text-align: center;">4</td>
  <td style="text-align: right;">3</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: center;">0</td>
  <td style="text-align: right;">1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I would like to create a loop that adds a new column called &quot;Total&quot;, which takes the value of col1 index 0 (5) and enters that value under the column &quot;Total&quot; at index 0. The next iteration, will col2 index 1 (4) and that value will go under column &quot;Total&quot; at index 1. This step will continue all columns and rows are completed.</p>
  <p>The ideal output will be the following:</p>
  <p>df1</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th style="text-align: left;">col1</th>
  <th style="text-align: center;">col2</th>
  <th style="text-align: right;">col3</th>
  <th style="text-align: right;">Total</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td style="text-align: left;">5</td>
  <td style="text-align: center;">3</td>
  <td style="text-align: right;">50</td>
  <td style="text-align: right;">5</td>
  </tr>
  <tr>
  <td style="text-align: left;">10</td>
  <td style="text-align: center;">4</td>
  <td style="text-align: right;">3</td>
  <td style="text-align: right;">4</td>
  </tr>
  <tr>
  <td style="text-align: left;">2</td>
  <td style="text-align: center;">0</td>
  <td style="text-align: right;">1</td>
  <td style="text-align: right;">1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I have the following code but I would like to find a more efficient way of doing this as I have a large DataFrame:</p>
  <pre><code>df1.iloc[0,3] = df1.iloc[0,0]
  df1.iloc[1,3] = df1.iloc[1,1]
  df1.iloc[2,3] = df1.iloc[2,2]
  </code></pre>
  <p>Thank you!</p>