title: Pandas: Reorder a data frame based on conditions
body: <p>I would like to reorder my dataframe based on certain conditions</p>
  <p>My original dataframe looks like</p>
  <pre><code>Merchant name         original_rnk
  Boohoo                1
  PRETTYLITTLETHING     2
  ASOS US               3
  PRINCESS POLLY        4
  URBAN OUTFITTERS      5
  KIM+ONO               6
  </code></pre>
  <p>And there is a reference dataframe that has some merchant information</p>
  <pre><code>Merchant name         order_cnt     profit     epc      
  Boohoo                200           30         0.6
  PRETTYLITTLETHING     100           -60        -0.4
  ASOS US               50            100        1.0
  PRINCESS POLLY        80            50         0.8
  URBAN OUTFITTERS      120           -20        -0.1
  KIM+ONO               500           90         0.7
  </code></pre>
  <p>I would like to give a new rank to these merchant based on their epc if their order_cnt &gt;= 100 and profit &gt;=0. <strong>The first merchant will always be the first no matter how much its order_cnt and profit are</strong>, but for the rest whose order_cnt &lt;100 or profit &lt;0, r their original order.</p>
  <p>So my desired output is</p>
  <pre><code>Merchant name         new_rnk     original_rnk
  Boohoo                1           1
  PRETTYLITTLETHING     3           2
  ASOS US               4           3
  PRINCESS POLLY        5           4
  URBAN OUTFITTERS      6           5
  KIM+ONO               2           6
  </code></pre>