Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python sort based on multiple keys

>>> def multisort(xs, specs):
...     for key, reverse in reversed(specs):
...         xs.sort(key=attrgetter(key), reverse=reverse)
...     return xs
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #python #sort #based #multiple #keys
ADD COMMENT
Topic
Name
9+8 =