Is it feasible to sort pandas dataframe by values of a column, but also by index?
If you sort a pandas dataframe by values of a column, you can get the resultant dat
To sort a column descending, while maintaining the index ascending:
import pandas as pd df = pd.DataFrame(index=range(5), data={'c': [4,2,2,4,2]}) df.index = df.index[::-1] print df.sort(column='c', ascending=False)
Output:
c 1 4 4 4 0 2 2 2 3 2