Processing math: 100%

Ярлыки

суббота, 3 ноября 2012 г.

Python: sorting of the "table" listoflists


There is list like "list of the lists": [1,2,3,4,5,6,7,8,9,[11,
12,13],14,15,16]
We can sort it by follow script:

import operator
...
myList.sortkey=operator.itemgetter(3)
 
If we can see cortege of number of "columns" in itemgetter forexample:(0,1), there is sorting order in this cortege.

Комментариев нет:

Отправить комментарий