0
myDataTradeSWE = myDataTrade[(myDataTrade['from']=='SWE') & (myDataTrade['Year']<2015)]
myDataTradeSWE.head(10) 

this is the code of the data frame and the data it returns the "VAL" column is the one i need to order from high to low.

Cory Kramer
  • 114,268
  • 16
  • 167
  • 218
esco
  • 71
  • 4
  • 1
    Does this answer your question? [how to sort pandas dataframe from one column](https://stackoverflow.com/questions/37787698/how-to-sort-pandas-dataframe-from-one-column) – not_speshal Dec 13 '21 at 18:40

1 Answers1

2

If you want to sort the entire DataFrame:

out = myDataTradeSWE.sort_values(by='VAL', ascending=False)

If you want to sort only VAL:

out = myDataTradeSWE['VAL'].sort_values(ascending=False)