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
In pandas 0.23+ you can do it directly - see OmerB's answer. If you don't yet have 0.23+, read on.
I'd venture that the simplest way is to just copy your index over to a column, and then sort by both.
df['colFromIndex'] = df.index
df = df.sort(['count', 'colFromIndex'])
I'd also prefer to be able to just do something like df.sort(['count', 'index']), but of course that doesn't work.