您的位置: 首页 > 文章 > np.sort()函数的作用 np.sort()函数的作用 分类: 文章 • 2024-04-16 17:32:43 np.sort函数的作用 np.sort()函数的作用 1.按行排序 2.按列排序 3.傻子才做选择,我都要!!! np.sort()函数的作用 np.sort()函数的作用是对给定的数组的元素进行排序 a:需要排序的数组 axis:指定按什么排序,默认axis = 1 按行排序, axis = 0 按列排序 1.按行排序 axis = 1 或为默认值,不写这个参数。结果如图: 2.按列排序 axis = 0 3.傻子才做选择,我都要!!! 先将按行或按列排序得出的数组保存起来,然后在进行一次按行或按列排序。 结果如图: