0

I have a data frame that has two columns, let's call A and B I want to sort A desc and B asc.

In order words, I want a list of elements which has a minor value in columns A and a greater value in column B

Is it possible?

Rodrigo
  • 135
  • 4
  • 45
  • 107

1 Answers1

1

pass 0 (false), 1 (true) to the ascending attribute in sort_values

df.sort_values(['cola','colb'], ascending=[0,1]

Naveed
  • 11,495
  • 2
  • 14
  • 21