arkouda.array_api.searching_functions

Functions

argmax(→ arkouda.array_api.array_object.Array)

Returns an array with the indices of the maximum values along a given axis.

argmin(→ arkouda.array_api.array_object.Array)

Returns an array with the indices of the minimum values along a given axis.

nonzero(→ Tuple[arkouda.array_api.array_object.Array, ...)

Returns a tuple of arrays containing the indices of the non-zero elements of the input array.

searchsorted(→ arkouda.array_api.array_object.Array)

Given a sorted array x1, find the indices to insert elements from another array x2 such that

where(→ arkouda.array_api.array_object.Array)

Return elements, either from x1 or x2, depending on condition.

Module Contents

arkouda.array_api.searching_functions.argmax(x: arkouda.array_api.array_object.Array, /, *, axis: int | None = None, keepdims: bool = False) arkouda.array_api.array_object.Array[source]

Returns an array with the indices of the maximum values along a given axis.

Parameters:
  • x (Array) – The array to search for maximum values

  • axis (int, optional) – The axis along which to search for maximum values. If None, the array is flattened before searching.

  • keepdims (bool, optional) – Whether to keep the singleton dimension along axis in the result.

arkouda.array_api.searching_functions.argmin(x: arkouda.array_api.array_object.Array, /, *, axis: int | None = None, keepdims: bool = False) arkouda.array_api.array_object.Array[source]

Returns an array with the indices of the minimum values along a given axis.

Parameters:
  • x (Array) – The array to search for minimum values

  • axis (int, optional) – The axis along which to search for minimum values. If None, the array is flattened before searching.

  • keepdims (bool, optional) – Whether to keep the singleton dimension along axis in the result.

arkouda.array_api.searching_functions.nonzero(x: arkouda.array_api.array_object.Array, /) Tuple[arkouda.array_api.array_object.Array, Ellipsis][source]

Returns a tuple of arrays containing the indices of the non-zero elements of the input array.

arkouda.array_api.searching_functions.searchsorted(x1: arkouda.array_api.array_object.Array, x2: arkouda.array_api.array_object.Array, /, *, side: Literal['left', 'right'] = 'left', sorter: arkouda.array_api.array_object.Array | None = None) arkouda.array_api.array_object.Array[source]

Given a sorted array x1, find the indices to insert elements from another array x2 such that the sorted order is maintained.

Parameters:
  • x1 (Array) – The sorted array to search in.

  • x2 (Array) – The values to search for in x1.

  • side ({'left', 'right'}, optional) – If ‘left’, the index of the first suitable location found is given. If ‘right’, return the last such index. Default is ‘left’.

  • sorter (Array, optional) – The indices that would sort x1 in ascending order. If None, x1 is assumed to be sorted.

arkouda.array_api.searching_functions.where(condition: arkouda.array_api.array_object.Array, x1: arkouda.array_api.array_object.Array, x2: arkouda.array_api.array_object.Array, /) arkouda.array_api.array_object.Array[source]

Return elements, either from x1 or x2, depending on condition.

Parameters:
  • condition (Array) – When condition[i] is True, store x1[i] in the output array, otherwise store x2[i].

  • x1 (Array) – Values selected at indices where condition is True.

  • x2 (Array) – Values selected at indices where condition is False.