Mimic spyder sort column

Viewed 296

I had a quick question: I am using Spyder, and a neat feature is in the variable explorer tab, I am able to click the headers and sort columns. However I am unable to reproduce the same sort order when I try to use:

df.sort_values()

in python. I'm wondering if there is any way to reproduce the order of a Spyder sort, in python code.

2 Answers

I think you need to to specify the new data frame variable for example:

df=df.sort_values([column])
Related