title: Reset index after sorting data frame
body: <p><strong>Take this dataset.</strong></p>
  
  <p><a href="https://i.stack.imgur.com/ZU97z.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZU97z.png" alt="![Take this dataset."></a></p>
  
  <p><strong>I sorted the data frame by Cancer_type column which contains [0,1] values,</strong></p>
  
  <p><code>df_genes.sort_values(['Cancer_type'], ascending=True)</code></p>
  
  <p><a href="https://i.stack.imgur.com/dRG6b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dRG6b.png" alt="![enter image description here"></a></p>
  
  <p><strong>Then I reset the index.</strong></p>
  
  <pre><code>df_genes.reset_index(drop=True,inplace=True)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/cGbBz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cGbBz.png" alt="![enter image description here"></a></p>
  
  <p>Resetting index messes up the Cancer_type column.
  How should I reset the index keeping the Cancer_type column sorted.
  This <a href="https://stackoverflow.com/questions/33165734/update-index-after-sorting-data-frame">link</a> follows same procedure but I'm getting different results.</p>