-1

I am sorting a 2D list in Python. Right now I sorted the list in an ascending order based on the first column. My list look like this:

Enter image description here

Now only sort those rows which have the same element at first column, based on second column. And it should look like this:

Enter image description here

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Haobo Yang
  • 27
  • 5

1 Answers1

0

I believe you're asking a combination of these two questions:

  1. How to sort a list in Python by multiple attributes: Sort a list by multiple attributes?.

  2. How to sort by date in Python: How do I sort this list in Python, if my date is in a String?

Hopefully those answers help.

Community
  • 1
  • 1
spamduck
  • 331
  • 2
  • 6