Take this dataset.
I sorted the data frame by Cancer_type column which contains [0,1] values,
df_genes.sort_values(['Cancer_type'], ascending=True)
Then I reset the index.
df_genes.reset_index(drop=True,inplace=True)
Resetting index messes up the Cancer_type column. How should I reset the index keeping the Cancer_type column sorted. This link follows same procedure but I'm getting different results.


