<human>:  how to sort 2d array by row in python?
<bot>: Here is some code to sort 2d array `matrix` by row with index 1

sorted(matrix, key=itemgetter(1))

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.