sort 2d array in python

There are many ways to sort a 2d arrays.

In general, you can use the sorted(), np.array.sort(),…

But you should also understand

  • what is meaning of list1.sort(list2)
  • ravel() vs. flatten()
  • what return the  key function back in sorted()
  • what will be returned by np.lexsort(), np.argsort()

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.