The Python Oracle

How to sort a dataFrame in python pandas by two or more columns?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzle Island

--

Chapters
00:00 Question
00:28 Accepted answer (Score 792)
01:47 Answer 2 (Score 76)
02:17 Answer 3 (Score 13)
03:32 Thank you

--

Full question
https://stackoverflow.com/questions/1714...

Accepted answer links:
[sort]: http://pandas.pydata.org/pandas-docs/ver...
[sort_values]: http://pandas.pydata.org/pandas-docs/sta...
[sort]: http://pandas.pydata.org/pandas-docs/sta...

Answer 3 links:
[numpy.lexsort]: https://docs.scipy.org/doc/numpy-1.14.0/...
[np.lexsort]: https://docs.scipy.org/doc/numpy/referen...
[pd.DataFrame.sort_values]: https://pandas.pydata.org/pandas-docs/st...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #pandas #python27 #sorting #dataanalysis

#avk47