Sorting, searching, and counting#

Sorting#

argpartition(a, kth[, axis, kind, order])

Perform an indirect partition along the given axis.

argsort(a[, axis, kind, order])

Returns the indices that would sort an array.

partition(a, kth[, axis, kind, order])

Returns a partitioned copy of an array.

sort(a[, axis, kind, order])

Returns a sorted copy of an array.

sort_complex(a)

Returns a sorted copy of an array sorted along the last axis.

Searching#

argmax(a[, axis, out, keepdims])

Returns the indices of the maximum values along an axis.

argmin(a[, axis, out, keepdims])

Returns the indices of the minimum values along an axis.

argwhere(a)

Find the indices of array elements that are non-zero, grouped by element.

flatnonzero(a)

Return indices that are non-zero in the flattened version of a.

nanargmax(a[, axis, out, keepdims])

Return the indices of the maximum values in the specified axis ignoring NaNs.

nanargmin(a[, axis, out, keepdims])

Return the indices of the minimum values in the specified axis ignoring NaNs.

nonzero(a)

Return the indices of the elements that are non-zero.

searchsorted(a, v[, side, sorter])

Find the indices into a sorted array a such that, if the corresponding elements in v were inserted before the indices, the order of a would be preserved.

extract(condition, arr)

Return the elements of an array that satisfy some condition.

where(condition, [x, y])

Return elements chosen from x or y depending on condition.

Counting#

count_nonzero(a[, axis])

Counts the number of non-zero values in the array a.