What is the most efficient way to sort two numpy matrices in parallel, row by row? A toy example:
sort this alpha:
a = [['c', 'b', 'e', 'd'],
['a', 'd', 'b', 'e']]
b = [['1', '2', '3', '4'],
['2', '1', '4', '3']]
a = [['b', 'c', 'd', 'e'],
['a', 'b', 'd', 'e']]
b = [['2', '1', '4', '3'],
['2', '4', '1', '3']]
You can use advanced indexing

idxx = np.arange(a.shape[0])[:,None],a.argsort(1)
a_out = a[idxx]
b_out = b[idxx]
Sample run 
In [75]: a
Out[75]:
array([['b', 'c', 'd', 'e'],
['a', 'b', 'd', 'e']],
dtype='S1')
In [76]: b
Out[76]:
array([['2', '1', '4', '3'],
['2', '4', '1', '3']],
dtype='S1')
In [77]: a_out
Out[77]:
array([['b', 'c', 'd', 'e'],
['a', 'b', 'd', 'e']],
dtype='S1')
In [78]: b_out
Out[78]:
array([['2', '1', '4', '3'],
['2', '4', '1', '3']],
dtype='S1')