8

I have a Python Pandas Data Frame. The df has 2 columns, I would like to sort the df by the second column.

   Kappa_prod   Angle
0   0.004511    -5.457840
1   0.003977    -5.312861
2   0.004476    -5.311292
3   0.003644    -117.579594
4   0.003306    -117.542817

I would like to sort the df by Angle (ascending order).

0

1 Answer 1

24

You can use this:

df.sort_values("Angle", inplace=True)

By default ascending=True is passed to the above call. For more information check the documentation here.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.