How can I sort an array in NumPy by the nth column?
For example,
a = array([[9, 2, 3], [4, 5, 6], [7, 0, 5]])
#for sorting along column 1
indexofsort=np.argsort(dataset[:,0],axis=-1,kind='stable') dataset = dataset[indexofsort,:]