排序,搜索和计数(Sorting, searching, and counting)

排序(Sorting)

methoddescription
sortopen in new window(a[, axis, kind, order])返回数组的排序副本。
lexsortopen in new window(keys[, axis])使用键的序列执行间接稳定排序。
argsortopen in new window(a[, axis, kind, order])返回将对数组进行排序的索引。
ndarray.sortopen in new window([axis, kind, order])就地排序数组。
msortopen in new window(a)返回沿第一个指针排序的数组的副本。
sort_complexopen in new window(a)首先使用实部,然后使用虚部对复杂数组进行排序。
partitionopen in new window(a, kth[, axis, kind, order])返回数组的分区副本。
argpartitionopen in new window(a, kth[, axis, kind, order])使用kind关键字指定的算法,沿给定的指针执行间接分区。

Searching

methoddescription
argmaxopen in new window(a[, axis, out])Returns the indices of the maximum values along an axis.
nanargmaxopen in new window(a[, axis])Return the indices of the maximum values in the specified axis ignoring NaNs.
argminopen in new window(a[, axis, out])Returns the indices of the minimum values along an axis.
nanargminopen in new window(a[, axis])Return the indices of the minimum values in the specified axis ignoring NaNs.
argwhereopen in new window(a)Find the indices of array elements that are non-zero, grouped by element.
nonzeroopen in new window(a)Return the indices of the elements that are non-zero.
flatnonzeroopen in new window(a)Return indices that are non-zero in the flattened version of a.
whereopen in new window(condition, [x, y])Return elements chosen from x or y depending on condition.
searchsortedopen in new window(a, v[, side, sorter])Find indices where elements should be inserted to maintain order.
extractopen in new window(condition, arr)Return the elements of an array that satisfy some condition.

Counting

methoddescription
count_nonzeroopen in new window(a[, axis])Counts the number of non-zero values in the array a.