I'm fairly sure this is a duplicate, but suppose I have a pandas DataFrame and I've sorted the rows based on the values of some column. Originally the indices were the integers 0, 1, …, n-1 but now they're out of order. How do I reassign these indices to be in the proper order for the new sorted DataFrame?
Add a comment
|