def sort_rows_by_icol1(self,inarray): idex=np.lexsort([inarray[:,0],inarray[:,1]]) a_sort=inarray[idex,:] return a_sort