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
Pandas 0.23 finally gets you there :-D
You can now pass index names (and not only column names) as parameters to sort_values. So, this one-liner works:
df = df.sort_values(by = ['MyCol', 'MyIdx'], ascending = [False, True])
And if your index is currently unnamed:
df = df.rename_axis('MyIdx').sort_values(by = ['MyCol', 'MyIdx'], ascending = [False, True])