Horje
python sort a 2d array by custom function Code Example
python sort a 2d array by custom function
>>> a = [
     [12, 18, 6, 3], 
     [ 4,  3, 1, 2], 
     [15,  8, 9, 6]
]
>>> a.sort(key=lambda x: x[1])
>>> a
[[4,  3,  1, 2], 
 [15, 8,  9, 6], 
 [12, 18, 6, 3]]




Python

Related
turn list in to word python Code Example turn list in to word python Code Example
enumerate in range python Code Example enumerate in range python Code Example
echo $pythonpath  ubuntu set default Code Example echo $pythonpath ubuntu set default Code Example
dict column to be in multiple columns python Code Example dict column to be in multiple columns python Code Example
for loop example python 3 Code Example for loop example python 3 Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7