numpy np.sort()函数(指定对某一轴进行排序,返回数组的排序副本)(成对数组不要用这个排,用哪个啥lexsort()或argsort()都行)
指定对哪一层进行排序,如果需排序的是多维数组,特别是那种np.sort()貌似不太友好 from numpy\core\fromnumeric.py @array_function_dispatch ( _sort_dispatcher ) def sort ( a , axis = - 1 , kind = None , order = None ) : """ Return a sorted copy of an array. 返回数组的排序副本。 Parameters ---------- a : array_like Array to be sorted. axis : int or None, optional Axis along which to sort. If None, the array is flattened before sorting. The default is -1, which sorts along the last axis. 要排序的轴。 如果为None,则在排序之前将数组展平。 默认值为-1,它沿着最后一个轴排序。 kind : {'quicksort', 'mergesort', 'heapsort', 'stable'}, optional Sorting algorithm. The default is 'quicksort'.