title: Pandas loop issue
body: <p>I am trying to apply the loop to select the specific values to use in the equation. I have the following data set</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>stock</th>
  <th>Demand</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1585</td>
  <td>-1677</td>
  </tr>
  <tr>
  <td>2305</td>
  <td>20</td>
  </tr>
  <tr>
  <td>34215</td>
  <td>-38968</td>
  </tr>
  <tr>
  <td>30</td>
  <td>70</td>
  </tr>
  <tr>
  <td>10967</td>
  <td>-4737</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I am applying the following code</p>
  <pre><code>for i in Demand:
      if i &gt; df['Stock'].all():
          Order = Demand
      elif i &lt; 0 :
          Order = df['Stock'] - Demand 
  </code></pre>
  <p>I want the following list</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Order</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>3262</td>
  </tr>
  <tr>
  <td>23005</td>
  </tr>
  <tr>
  <td>73183</td>
  </tr>
  <tr>
  <td>70</td>
  </tr>
  <tr>
  <td>15704</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>But I am getting the following list</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>Order</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>3262</td>
  </tr>
  <tr>
  <td>23005</td>
  </tr>
  <tr>
  <td>73183</td>
  </tr>
  <tr>
  <td><strong>-39</strong></td>
  </tr>
  <tr>
  <td>15704</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I am unable to figure out what is wrong with the loop I am applying here.
  Thank you.</p>